prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>rule_008.py<|end_file_name|><|fim▁begin|> from vsg.rules import token_prefix from vsg import token lTokens = [] lTokens.append(token.signal_declaration.identifier) class rule_008(token_prefix): <|fim_middle|> <|fim▁end|>
''' This rule checks for valid prefixes on signal identifiers. Default signal prefix is *s\_*. |configuring_prefix_and_suffix_rules_link| **Violation** .. code-block:: vhdl signal wr_en : std_logic; signal rd_en : std_logic; **Fix** .. code-block:: vhdl signal...
<|file_name|>rule_008.py<|end_file_name|><|fim▁begin|> from vsg.rules import token_prefix from vsg import token lTokens = [] lTokens.append(token.signal_declaration.identifier) class rule_008(token_prefix): ''' This rule checks for valid prefixes on signal identifiers. Default signal prefix is *s\_*. ...
token_prefix.__init__(self, 'signal', '008', lTokens) self.prefixes = ['s_'] self.solution = 'Signal identifiers'
<|file_name|>rule_008.py<|end_file_name|><|fim▁begin|> from vsg.rules import token_prefix from vsg import token lTokens = [] lTokens.append(token.signal_declaration.identifier) class rule_008(token_prefix): ''' This rule checks for valid prefixes on signal identifiers. Default signal prefix is *s\_*. ...
__init__
<|file_name|>euler_17.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python -Wall # -*- coding: utf-8 -*- """ <div id="content"> <div style="text-align:center;" class="print"><img src="images/print_page_logo.png" alt="projecteuler.net" style="border:none;" /></div> <h2>Number letter counts</h2><div id="problem_info" class=...
<|file_name|>euler_17.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python -Wall # -*- coding: utf-8 -*- """ <div id="content"> <div style="text-align:center;" class="print"><img src="images/print_page_logo.png" alt="projecteuler.net" style="border:none;" /></div> <h2>Number letter counts</h2><div id="problem_info" class=...
if(i<100): s[i]=s[i/10*10]+s[i%10] else: s[i]=s[i/100]+"hundred" if(i%100): s[i]+="and"+s[i%100]
<|file_name|>euler_17.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python -Wall # -*- coding: utf-8 -*- """ <div id="content"> <div style="text-align:center;" class="print"><img src="images/print_page_logo.png" alt="projecteuler.net" style="border:none;" /></div> <h2>Number letter counts</h2><div id="problem_info" class=...
s[i]=s[i/10*10]+s[i%10]
<|file_name|>euler_17.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python -Wall # -*- coding: utf-8 -*- """ <div id="content"> <div style="text-align:center;" class="print"><img src="images/print_page_logo.png" alt="projecteuler.net" style="border:none;" /></div> <h2>Number letter counts</h2><div id="problem_info" class=...
s[i]=s[i/100]+"hundred" if(i%100): s[i]+="and"+s[i%100]
<|file_name|>euler_17.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python -Wall # -*- coding: utf-8 -*- """ <div id="content"> <div style="text-align:center;" class="print"><img src="images/print_page_logo.png" alt="projecteuler.net" style="border:none;" /></div> <h2>Number letter counts</h2><div id="problem_info" class=...
s[i]+="and"+s[i%100]
<|file_name|>test_greatest_common_divisor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import unittest import greatest_common_divisor as gcd class TestGreatestCommonDivisor(unittest.TestCase): def setUp(self): # use tuple of tuples instead of list of tuples because data won't change # ...
<|file_name|>test_greatest_common_divisor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import unittest import greatest_common_divisor as gcd class TestGreatestCommonDivisor(unittest.TestCase): <|fim_middle|> if __name__ == "__main__": unittest.main() <|fim▁end|>
def setUp(self): # use tuple of tuples instead of list of tuples because data won't change # https://en.wikipedia.org/wiki/Algorithm # a, b, expected self.test_data = ((12, 8, 4), (9, 12, 3), (54, 24, 6), (...
<|file_name|>test_greatest_common_divisor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import unittest import greatest_common_divisor as gcd class TestGreatestCommonDivisor(unittest.TestCase): def setUp(self): # use tuple of tuples instead of list of tuples because data won't change # ...
self.test_data = ((12, 8, 4), (9, 12, 3), (54, 24, 6), (3009, 884, 17), (40902, 24140, 34), (14157, 5950, 1) )
<|file_name|>test_greatest_common_divisor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import unittest import greatest_common_divisor as gcd class TestGreatestCommonDivisor(unittest.TestCase): def setUp(self): # use tuple of tuples instead of list of tuples because data won't change # ...
actual = gcd.GreatestCommonDivisor.greatest_common_divisor(12, 0) self.assertEqual(0, actual) actual = gcd.GreatestCommonDivisor.greatest_common_divisor(0, 13) self.assertEqual(0, actual) actual = gcd.GreatestCommonDivisor.greatest_common_divisor(-5, 13) self.assertEqual(...
<|file_name|>test_greatest_common_divisor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import unittest import greatest_common_divisor as gcd class TestGreatestCommonDivisor(unittest.TestCase): def setUp(self): # use tuple of tuples instead of list of tuples because data won't change # ...
for test_case in self.test_data: expected = test_case[2] actual = gcd.GreatestCommonDivisor.greatest_common_divisor(test_case[0], test_case[1]) fail_message = str.format("expected {0} but got {1}", expected, actual) self.assertEqual(expected, actual, fail_message)
<|file_name|>test_greatest_common_divisor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import unittest import greatest_common_divisor as gcd class TestGreatestCommonDivisor(unittest.TestCase): def setUp(self): # use tuple of tuples instead of list of tuples because data won't change # ...
actual = gcd.GreatestCommonDivisor.next_smaller_divisor(8, 8) self.assertEqual(4, actual) actual = gcd.GreatestCommonDivisor.next_smaller_divisor(12, 12) self.assertEqual(6, actual) actual = gcd.GreatestCommonDivisor.next_smaller_divisor(12, 6) self.assertEqual(4, actual)...
<|file_name|>test_greatest_common_divisor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import unittest import greatest_common_divisor as gcd class TestGreatestCommonDivisor(unittest.TestCase): def setUp(self): # use tuple of tuples instead of list of tuples because data won't change # ...
unittest.main()
<|file_name|>test_greatest_common_divisor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import unittest import greatest_common_divisor as gcd class TestGreatestCommonDivisor(unittest.TestCase): def <|fim_middle|>(self): # use tuple of tuples instead of list of tuples because data won't change ...
setUp
<|file_name|>test_greatest_common_divisor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import unittest import greatest_common_divisor as gcd class TestGreatestCommonDivisor(unittest.TestCase): def setUp(self): # use tuple of tuples instead of list of tuples because data won't change # ...
test_greatest_common_divisor_zero
<|file_name|>test_greatest_common_divisor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import unittest import greatest_common_divisor as gcd class TestGreatestCommonDivisor(unittest.TestCase): def setUp(self): # use tuple of tuples instead of list of tuples because data won't change # ...
test_greatest_common_divisor
<|file_name|>test_greatest_common_divisor.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3 import unittest import greatest_common_divisor as gcd class TestGreatestCommonDivisor(unittest.TestCase): def setUp(self): # use tuple of tuples instead of list of tuples because data won't change # ...
test_next_smaller_divisor
<|file_name|>urls.py<|end_file_name|><|fim▁begin|>from django.conf.urls import url from admin.nodes import views app_name = 'admin' urlpatterns = [ url(r'^$', views.NodeFormView.as_view(), name='search'), url(r'^flagged_spam$', views.NodeFlaggedSpamList.as_view(), name='flagged-spam'), url...
name='node'), url(r'^(?P<guid>[a-z0-9]+)/logs/$', views.AdminNodeLogView.as_view(), name='node-logs'),
<|file_name|>shtest-format.py<|end_file_name|><|fim▁begin|># Check the various features of the ShTest format. # # RUN: not %{lit} -j 1 -v %{inputs}/shtest-format > %t.out # RUN: FileCheck < %t.out %s # # END. # CHECK: -- Testing: # CHECK: FAIL: shtest-format :: external_shell/fail.txt # CHECK: *** TEST 'shtest-format...
# CHECK: Unexpected Passes : 1 # CHECK: Unexpected Failures: 2
<|file_name|>streaming_wordcount_it_test.py<|end_file_name|><|fim▁begin|># # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to Yo...
self.pub_client = pubsub.PublisherClient()
<|file_name|>streaming_wordcount_it_test.py<|end_file_name|><|fim▁begin|># # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to Yo...
def setUp(self): self.test_pipeline = TestPipeline(is_integration_test=True) self.project = self.test_pipeline.get_option('project') self.uuid = str(uuid.uuid4()) # Set up PubSub environment. from google.cloud import pubsub self.pub_client = pubsub.PublisherClient() self.input_topic = sel...
<|file_name|>streaming_wordcount_it_test.py<|end_file_name|><|fim▁begin|># # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to Yo...
self.test_pipeline = TestPipeline(is_integration_test=True) self.project = self.test_pipeline.get_option('project') self.uuid = str(uuid.uuid4()) # Set up PubSub environment. from google.cloud import pubsub self.pub_client = pubsub.PublisherClient() self.input_topic = self.pub_client.create...
<|file_name|>streaming_wordcount_it_test.py<|end_file_name|><|fim▁begin|># # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to Yo...
"""Inject numbers as test data to PubSub.""" logging.debug('Injecting %d numbers to topic %s', num_messages, topic.name) for n in range(num_messages): self.pub_client.publish(self.input_topic.name, str(n).encode('utf-8'))
<|file_name|>streaming_wordcount_it_test.py<|end_file_name|><|fim▁begin|># # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to Yo...
test_utils.cleanup_subscriptions(self.sub_client, [self.input_sub, self.output_sub]) test_utils.cleanup_topics(self.pub_client, [self.input_topic, self.output_topic])
<|file_name|>streaming_wordcount_it_test.py<|end_file_name|><|fim▁begin|># # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to Yo...
expected_msg = [('%d: 1' % num).encode('utf-8') for num in range(DEFAULT_INPUT_NUMBERS)] # Set extra options to the pipeline for test purpose state_verifier = PipelineStateMatcher(PipelineState.RUNNING) pubsub_msg_verifier = PubSubMessageMatcher(self.project, ...
<|file_name|>streaming_wordcount_it_test.py<|end_file_name|><|fim▁begin|># # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to Yo...
logging.getLogger().setLevel(logging.DEBUG) unittest.main()
<|file_name|>streaming_wordcount_it_test.py<|end_file_name|><|fim▁begin|># # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to Yo...
setUp
<|file_name|>streaming_wordcount_it_test.py<|end_file_name|><|fim▁begin|># # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to Yo...
_inject_numbers
<|file_name|>streaming_wordcount_it_test.py<|end_file_name|><|fim▁begin|># # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to Yo...
tearDown
<|file_name|>streaming_wordcount_it_test.py<|end_file_name|><|fim▁begin|># # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to Yo...
test_streaming_wordcount_it
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
with outfile: model_writer = RobotModelWriter(outfile, self._js_model, config) writer = HtmlFileWriter(outfile, model_writer) writer.write(template)
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
def __init__(self, js_model): self._js_model = js_model def _write_file(self, path, config, template): outfile = codecs.open(path, 'wb', encoding='UTF-8')\ if isinstance(path, basestring) else path # unit test hook with outfile: model_writer = RobotModelWriter(o...
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
self._js_model = js_model
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
outfile = codecs.open(path, 'wb', encoding='UTF-8')\ if isinstance(path, basestring) else path # unit test hook with outfile: model_writer = RobotModelWriter(outfile, self._js_model, config) writer = HtmlFileWriter(outfile, model_writer) writer.write(temp...
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
def __init__(self, output, model, config): self._output = output self._model = model self._config = config def write(self, line): JsResultWriter(self._output).write(self._model, self._config)
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
self._output = output self._model = model self._config = config
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
JsResultWriter(self._output).write(self._model, self._config)
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
def write(self, path, config): self._write_file(path, config, LOG) if self._js_model.split_results: self._write_split_logs(splitext(path)[0]) def _write_split_logs(self, base): for index, (keywords, strings) in enumerate(self._js_model.split_results): index += 1 ...
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
self._write_file(path, config, LOG) if self._js_model.split_results: self._write_split_logs(splitext(path)[0])
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
for index, (keywords, strings) in enumerate(self._js_model.split_results): index += 1 # enumerate accepts start index only in Py 2.6+ self._write_split_log(index, keywords, strings, '%s-%d.js' % (base, index))
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
with utf8open(path, 'wb') as outfile: writer = SplitLogWriter(outfile) writer.write(keywords, strings, index, basename(path))
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
def write(self, path, config): self._write_file(path, config, REPORT)
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
self._write_file(path, config, REPORT)
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
self._write_split_logs(splitext(path)[0])
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
__init__
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
_write_file
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
__init__
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
write
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
write
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
_write_split_logs
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
_write_split_log
<|file_name|>logreportwriters.py<|end_file_name|><|fim▁begin|># Copyright 2008-2012 Nokia Siemens Networks Oyj # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.o...
write
<|file_name|>brd-restructure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import os import argparse<|fim▁hole|> import logging import logging.config def get_rest_of_frame_molecule(frame_molecule, selected_molecule): # calc the rest selector = bridge.Select_AtomGroup(selected_...
import pprint import proteindf_bridge as bridge
<|file_name|>brd-restructure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import os import argparse import pprint import proteindf_bridge as bridge import logging import logging.config def get_rest_of_frame_molecule(frame_molecule, selected_molecule): # calc the rest <|fim_...
selector = bridge.Select_AtomGroup(selected_molecule) selected = frame_molecule.select(selector) rest_molecule = frame_molecule ^ selected return rest_molecule
<|file_name|>brd-restructure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import os import argparse import pprint import proteindf_bridge as bridge import logging import logging.config def get_rest_of_frame_molecule(frame_molecule, selected_molecule): # calc the rest select...
chain = bridge.AtomGroup() res = bridge.AtomGroup() res.name = res_name atom_id = 1 for atom in rest_molecule.get_atom_list(): res.set_atom(atom_id, atom) atom_id += 1 chain.set_group(1, res) output_atom_group[model_id].set_group(chain_id, chain)
<|file_name|>brd-restructure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import os import argparse import pprint import proteindf_bridge as bridge import logging import logging.config def get_rest_of_frame_molecule(frame_molecule, selected_molecule): # calc the rest select...
parser = argparse.ArgumentParser( description='restructure brd file by reference file') parser.add_argument('target_brd_path', nargs=1, help='target brd file') parser.add_argument('ref_brd_path', nargs=1, ...
<|file_name|>brd-restructure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import os import argparse import pprint import proteindf_bridge as bridge import logging import logging.config def get_rest_of_frame_molecule(frame_molecule, selected_molecule): # calc the rest select...
print("target: {}".format(target_brd_path)) print("reference: {}".format(ref_brd_path))
<|file_name|>brd-restructure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import os import argparse import pprint import proteindf_bridge as bridge import logging import logging.config def get_rest_of_frame_molecule(frame_molecule, selected_molecule): # calc the rest select...
if verbose: print("output brd file: {}".format(output_path)) bridge.save_atomgroup(restructured, output_path)
<|file_name|>brd-restructure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import os import argparse import pprint import proteindf_bridge as bridge import logging import logging.config def get_rest_of_frame_molecule(frame_molecule, selected_molecule): # calc the rest select...
print("output brd file: {}".format(output_path))
<|file_name|>brd-restructure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import os import argparse import pprint import proteindf_bridge as bridge import logging import logging.config def get_rest_of_frame_molecule(frame_molecule, selected_molecule): # calc the rest select...
main() # pr.disable() # pr.dump_stats('program.profile')
<|file_name|>brd-restructure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import os import argparse import pprint import proteindf_bridge as bridge import logging import logging.config def <|fim_middle|>(frame_molecule, selected_molecule): # calc the rest selector = bridge....
get_rest_of_frame_molecule
<|file_name|>brd-restructure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import os import argparse import pprint import proteindf_bridge as bridge import logging import logging.config def get_rest_of_frame_molecule(frame_molecule, selected_molecule): # calc the rest select...
assign_rest_molecule
<|file_name|>brd-restructure.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import os import argparse import pprint import proteindf_bridge as bridge import logging import logging.config def get_rest_of_frame_molecule(frame_molecule, selected_molecule): # calc the rest select...
main
<|file_name|>setup.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # # # TheVirtualBrain-Framework Package. This package holds all Data Management, and # Web-UI helpful to run brain-simulations. To use it, you also need do download # TheVirtualBrain-Scientific Package (for simulators). See content of the # doc...
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public # License for more details. You should have received a copy of the GNU General # Public License along with this program; if not, you can download it here
<|file_name|>badge_maker.py<|end_file_name|><|fim▁begin|>""" Drone.io badge generator. Currently set up to work on Mac. Requires Pillow. """ import os from PIL import Image, ImageDraw, ImageFont SIZE = (95, 18) def hex_colour(hex): if hex[0] == '#': hex = hex[1:] return ( int(hex[:2], 16), ...
drawing.text((63, PADDING_TOP+1), '%s%%' % percentage, font=FONT, fill=FONT_SHADOW)
<|file_name|>badge_maker.py<|end_file_name|><|fim▁begin|>""" Drone.io badge generator. Currently set up to work on Mac. Requires Pillow. """ import os from PIL import Image, ImageDraw, ImageFont SIZE = (95, 18) def hex_colour(hex): <|fim_middle|> BACKGROUND = hex_colour('#4A4A4A') SUCCESS = hex_colour('#94B9...
if hex[0] == '#': hex = hex[1:] return ( int(hex[:2], 16), int(hex[2:4], 16), int(hex[4:6], 16), )
<|file_name|>badge_maker.py<|end_file_name|><|fim▁begin|>""" Drone.io badge generator. Currently set up to work on Mac. Requires Pillow. """ import os from PIL import Image, ImageDraw, ImageFont SIZE = (95, 18) def hex_colour(hex): if hex[0] == '#': hex = hex[1:] return ( int(hex[:2], 16), ...
image = Image.new('RGB', SIZE, color=BACKGROUND) drawing = ImageDraw.Draw(image) drawing.rectangle([(55, 0), SIZE], colour, colour) drawing.text((8, PADDING_TOP+1), 'coverage', font=FONT, fill=FONT_SHADOW) drawing.text((7, PADDING_TOP), 'coverage', font=FONT) drawing.text((63, PADDING_...
<|file_name|>badge_maker.py<|end_file_name|><|fim▁begin|>""" Drone.io badge generator. Currently set up to work on Mac. Requires Pillow. """ import os from PIL import Image, ImageDraw, ImageFont SIZE = (95, 18) def hex_colour(hex): if hex[0] == '#': <|fim_middle|> return ( int(hex[...
hex = hex[1:]
<|file_name|>badge_maker.py<|end_file_name|><|fim▁begin|>""" Drone.io badge generator. Currently set up to work on Mac. Requires Pillow. """ import os from PIL import Image, ImageDraw, ImageFont SIZE = (95, 18) def hex_colour(hex): if hex[0] == '#': hex = hex[1:] return ( int(hex[:2], 16), ...
build_image(i, ERROR).save(file)
<|file_name|>badge_maker.py<|end_file_name|><|fim▁begin|>""" Drone.io badge generator. Currently set up to work on Mac. Requires Pillow. """ import os from PIL import Image, ImageDraw, ImageFont SIZE = (95, 18) def hex_colour(hex): if hex[0] == '#': hex = hex[1:] return ( int(hex[:2], 16), ...
build_image(i, WARNING).save(file)
<|file_name|>badge_maker.py<|end_file_name|><|fim▁begin|>""" Drone.io badge generator. Currently set up to work on Mac. Requires Pillow. """ import os from PIL import Image, ImageDraw, ImageFont SIZE = (95, 18) def hex_colour(hex): if hex[0] == '#': hex = hex[1:] return ( int(hex[:2], 16), ...
build_image(i, SUCCESS).save(file)
<|file_name|>badge_maker.py<|end_file_name|><|fim▁begin|>""" Drone.io badge generator. Currently set up to work on Mac. Requires Pillow. """ import os from PIL import Image, ImageDraw, ImageFont SIZE = (95, 18) def <|fim_middle|>(hex): if hex[0] == '#': hex = hex[1:] return ( int(hex[:2], 1...
hex_colour
<|file_name|>badge_maker.py<|end_file_name|><|fim▁begin|>""" Drone.io badge generator. Currently set up to work on Mac. Requires Pillow. """ import os from PIL import Image, ImageDraw, ImageFont SIZE = (95, 18) def hex_colour(hex): if hex[0] == '#': hex = hex[1:] return ( int(hex[:2], 16), ...
build_image
<|file_name|>_showexponent.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators<|fim▁hole|> class ShowexponentValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="showexponent", parent_name="scatterpolar.marker.colorbar", **kwar...
<|file_name|>_showexponent.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators class ShowexponentValidator(_plotly_utils.basevalidators.EnumeratedValidator): <|fim_middle|> <|fim▁end|>
def __init__( self, plotly_name="showexponent", parent_name="scatterpolar.marker.colorbar", **kwargs ): super(ShowexponentValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_type=kwargs.pop("edit_type", "co...
<|file_name|>_showexponent.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators class ShowexponentValidator(_plotly_utils.basevalidators.EnumeratedValidator): def __init__( self, plotly_name="showexponent", parent_name="scatterpolar.marker.colorbar", **kwargs ): ...
super(ShowexponentValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, edit_type=kwargs.pop("edit_type", "colorbars"), values=kwargs.pop("values", ["all", "first", "last", "none"]), **kwargs )
<|file_name|>_showexponent.py<|end_file_name|><|fim▁begin|>import _plotly_utils.basevalidators class ShowexponentValidator(_plotly_utils.basevalidators.EnumeratedValidator): def <|fim_middle|>( self, plotly_name="showexponent", parent_name="scatterpolar.marker.colorbar", **kwargs ...
__init__
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*- # © 2014 Elico Corp (https://www.elico-corp.com) # Licence AGPL-3.0 or later(http://www.gnu.org/licenses/agpl.html) <|fim▁hole|><|fim▁end|>
import invoice
<|file_name|>Plugins.py<|end_file_name|><|fim▁begin|># # # (C) Copyright 2001 The Internet (Aust) Pty Ltd # ACN: 082 081 472 ABN: 83 082 081 472 # All Rights Reserved # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMP...
# Author: Andrew Milton <akm@theinternet.com.au> # $Id: Plugins.py,v 1.5 2004/11/10 14:15:33 akm Exp $ import App, Globals, OFS
<|file_name|>Plugins.py<|end_file_name|><|fim▁begin|># # # (C) Copyright 2001 The Internet (Aust) Pty Ltd # ACN: 082 081 472 ABN: 83 082 081 472 # All Rights Reserved # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMP...
def __init__(self, name, description, pluginClass, pluginStartForm, pluginStartMethod, pluginEditForm=None, pluginEditMethod=None): self.name=name #No Spaces please... self.description=description self.plugin=pluginClass self.manage_addForm=pluginStartForm self.manage_addMethod=pluginStartMethod ...
<|file_name|>Plugins.py<|end_file_name|><|fim▁begin|># # # (C) Copyright 2001 The Internet (Aust) Pty Ltd # ACN: 082 081 472 ABN: 83 082 081 472 # All Rights Reserved # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMP...
self.name=name #No Spaces please... self.description=description self.plugin=pluginClass self.manage_addForm=pluginStartForm self.manage_addMethod=pluginStartMethod self.manage_editForm=pluginEditForm self.manage_editMethod=pluginEditMethod
<|file_name|>Plugins.py<|end_file_name|><|fim▁begin|># # # (C) Copyright 2001 The Internet (Aust) Pty Ltd # ACN: 082 081 472 ABN: 83 082 081 472 # All Rights Reserved # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMP...
def __init__(self, name, crypto, description, pluginMethod): self.name = name #No Spaces please... self.cryptoMethod = crypto self.description = description self.plugin = pluginMethod
<|file_name|>Plugins.py<|end_file_name|><|fim▁begin|># # # (C) Copyright 2001 The Internet (Aust) Pty Ltd # ACN: 082 081 472 ABN: 83 082 081 472 # All Rights Reserved # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMP...
self.name = name #No Spaces please... self.cryptoMethod = crypto self.description = description self.plugin = pluginMethod
<|file_name|>Plugins.py<|end_file_name|><|fim▁begin|># # # (C) Copyright 2001 The Internet (Aust) Pty Ltd # ACN: 082 081 472 ABN: 83 082 081 472 # All Rights Reserved # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMP...
__init__
<|file_name|>Plugins.py<|end_file_name|><|fim▁begin|># # # (C) Copyright 2001 The Internet (Aust) Pty Ltd # ACN: 082 081 472 ABN: 83 082 081 472 # All Rights Reserved # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMP...
__init__
<|file_name|>test_demos_desordre.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- import os from abjad import abjad_configuration from abjad.demos import desordre <|fim▁hole|> lilypond_file = desordre.make_desordre_lilypond_file()<|fim▁end|>
def test_demos_desordre_01():
<|file_name|>test_demos_desordre.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- import os from abjad import abjad_configuration from abjad.demos import desordre def test_demos_desordre_01(): <|fim_middle|> <|fim▁end|>
lilypond_file = desordre.make_desordre_lilypond_file()
<|file_name|>test_demos_desordre.py<|end_file_name|><|fim▁begin|># -*- encoding: utf-8 -*- import os from abjad import abjad_configuration from abjad.demos import desordre def <|fim_middle|>(): lilypond_file = desordre.make_desordre_lilypond_file()<|fim▁end|>
test_demos_desordre_01
<|file_name|>01-document.py<|end_file_name|><|fim▁begin|>import os, sys; sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..")) import codecs from pattern.vector import Document, PORTER, LEMMA # A Document is a "bag-of-words" that splits a string into words and counts them. # A list of words or dicti...
f = os.path.join(os.path.dirname(__file__), "corpus", "wolf.txt") s = codecs.open(f, encoding="utf-8").read() document = Document(s, name="wolf", stemmer=PORTER) print document
<|file_name|>models.py<|end_file_name|><|fim▁begin|>##-*-coding: utf-8 -*- from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Usage(models.Model): ip = models.CharField(max_length=50) method = models.CharField(max_length=3) path = ...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>##-*-coding: utf-8 -*- from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Usage(models.Model): <|fim_middle|> @python_2_unicode_compatible class Element(models.Model): name = model...
ip = models.CharField(max_length=50) method = models.CharField(max_length=3) path = models.CharField(max_length=100) params = models.CharField(max_length=255) def __str__(self): return self.ip
<|file_name|>models.py<|end_file_name|><|fim▁begin|>##-*-coding: utf-8 -*- from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Usage(models.Model): ip = models.CharField(max_length=50) method = models.CharField(max_length=3) path = ...
return self.ip
<|file_name|>models.py<|end_file_name|><|fim▁begin|>##-*-coding: utf-8 -*- from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Usage(models.Model): ip = models.CharField(max_length=50) method = models.CharField(max_length=3) path = ...
name = models.CharField(max_length=10) code = models.CharField(max_length=10) def __str__(self): return self.name class Meta: verbose_name = "ธาตุ" verbose_name_plural = "ธาตุต่างๆ" db_table = 'element' @python_2_unicode_compa
<|file_name|>models.py<|end_file_name|><|fim▁begin|>##-*-coding: utf-8 -*- from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Usage(models.Model): ip = models.CharField(max_length=50) method = models.CharField(max_length=3) path = ...
return self.name
<|file_name|>models.py<|end_file_name|><|fim▁begin|>##-*-coding: utf-8 -*- from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Usage(models.Model): ip = models.CharField(max_length=50) method = models.CharField(max_length=3) path = ...
verbose_name = "ธาตุ" verbose_name_plural = "ธาตุต่างๆ" db_table = 'element' @python_2_unicode_compa
<|file_name|>models.py<|end_file_name|><|fim▁begin|>##-*-coding: utf-8 -*- from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Usage(models.Model): ip = models.CharField(max_length=50) method = models.CharField(max_length=3) path = ...
x_length=100, unique=True) description = models.CharField(max_length=255, null=True) is_congenital = models.BooleanField(default=False) created_by = models.CharField(max_length=50, null=True) created_date = models.DateTimeField(auto_now_add=True) last_modified = models.DateTimeField(auto_now=Tru...
<|file_name|>models.py<|end_file_name|><|fim▁begin|>##-*-coding: utf-8 -*- from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Usage(models.Model): ip = models.CharField(max_length=50) method = models.CharField(max_length=3) path = ...
s Meta:
<|file_name|>models.py<|end_file_name|><|fim▁begin|>##-*-coding: utf-8 -*- from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Usage(models.Model): ip = models.CharField(max_length=50) method = models.CharField(max_length=3) path = ...
verbose_name_plural = "กลุ่มเชื้อโรค" db_table = 'disease' class Nutrient(models.Model): water = models.DecimalField(max