prompt
large_stringlengths
72
9.34k
completion
large_stringlengths
0
7.61k
<|file_name|>unassignedbugs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 import urllib2 import urllib from BeautifulSoup import BeautifulSoup import smtplib import ConfigParser # Retreive user information config = ConfigParser.ConfigParser() config.read('config.cfg') user = config.get('data','user') passwor...
page = False
<|file_name|>unassignedbugs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 import urllib2 import urllib from BeautifulSoup import BeautifulSoup import smtplib import ConfigParser # Retreive user information config = ConfigParser.ConfigParser() config.read('config.cfg') user = config.get('data','user') passwor...
print soup.findAll('a',{'id': 'next'}) count += 1 pages = True
<|file_name|>unassignedbugs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 import urllib2 import urllib from BeautifulSoup import BeautifulSoup import smtplib import ConfigParser # Retreive user information config = ConfigParser.ConfigParser() config.read('config.cfg') user = config.get('data','user') passwor...
new = "%s&pagenum=%s" % (url,count) msg += parse_bugtrackerpage(new,count)
<|file_name|>unassignedbugs.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 import urllib2 import urllib from BeautifulSoup import BeautifulSoup import smtplib import ConfigParser # Retreive user information config = ConfigParser.ConfigParser() config.read('config.cfg') user = config.get('data','user') passwor...
parse_bugtrackerpage
<|file_name|>_mod1_0_1_0_0_4.py<|end_file_name|><|fim▁begin|>name1_0_1_0_0_4_0 = None name1_0_1_0_0_4_1 = None name1_0_1_0_0_4_2 = None<|fim▁hole|> name1_0_1_0_0_4_4 = None<|fim▁end|>
name1_0_1_0_0_4_3 = None
<|file_name|>message_format_change_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 Confluent Inc. # # 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.org/licenses/LICE...
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.
<|file_name|>message_format_change_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 Confluent Inc. # # 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.org/licenses/LICE...
def __init__(self, test_context): super(MessageFormatChangeTest, self).__init__(test_context=test_context) def setUp(self): self.topic = "test_topic" self.zk = ZookeeperService(self.test_context, num_nodes=1) self.zk.start() # Producer and consumer ...
<|file_name|>message_format_change_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 Confluent Inc. # # 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.org/licenses/LICE...
super(MessageFormatChangeTest, self).__init__(test_context=test_context)
<|file_name|>message_format_change_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 Confluent Inc. # # 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.org/licenses/LICE...
self.topic = "test_topic" self.zk = ZookeeperService(self.test_context, num_nodes=1) self.zk.start() # Producer and consumer self.producer_throughput = 10000 self.num_producers = 1 self.num_consumers = 1 self.messages_per_producer = 100
<|file_name|>message_format_change_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 Confluent Inc. # # 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.org/licenses/LICE...
self.producer = VerifiableProducer(self.test_context, self.num_producers, self.kafka, self.topic, throughput=self.producer_throughput, message_validator=is_int, ...
<|file_name|>message_format_change_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 Confluent Inc. # # 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.org/licenses/LICE...
""" This tests performs the following checks: The workload is a mix of 0.9.x and 0.10.x producers and consumers that produce to and consume from a 0.10.x cluster 1. initially the topic is using message format 0.9.0 2. change the message format version for topic to 0.10.0 on the ...
<|file_name|>message_format_change_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 Confluent Inc. # # 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.org/licenses/LICE...
self.logger.info("Third format change back to 0.9.0") self.kafka.alter_message_format(self.topic, str(LATEST_0_9)) self.produce_and_consume(producer_version, consumer_version, "group3")
<|file_name|>message_format_change_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 Confluent Inc. # # 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.org/licenses/LICE...
__init__
<|file_name|>message_format_change_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 Confluent Inc. # # 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.org/licenses/LICE...
setUp
<|file_name|>message_format_change_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 Confluent Inc. # # 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.org/licenses/LICE...
produce_and_consume
<|file_name|>message_format_change_test.py<|end_file_name|><|fim▁begin|># Copyright 2015 Confluent Inc. # # 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.org/licenses/LICE...
test_compatibility
<|file_name|>schemamigration.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import sys INSTALLED_APPS = [ 'django.contrib.contenttypes', 'django.contrib.auth', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'mptt', 'cms', 'menus...
] DATABASES = {
<|file_name|>schemamigration.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import sys INSTALLED_APPS = [ 'django.contrib.contenttypes', 'django.contrib.auth', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'mptt', 'cms', 'menus...
from django.conf import settings from django.core.management import ManagementUtility settings.configure( INSTALLED_APPS=INSTALLED_APPS, ROOT_URLCONF=ROOT_URLCONF, DATABASES=DATABASES, TEMPLATE_CONTEXT_PROCESSORS=TEMPLATE_CONTEXT_PROCESSORS ) argv = list(sys.argv) ...
<|file_name|>schemamigration.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import sys INSTALLED_APPS = [ 'django.contrib.contenttypes', 'django.contrib.auth', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'mptt', 'cms', 'menus...
schemamigration()
<|file_name|>schemamigration.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python # -*- coding: utf-8 -*- import sys INSTALLED_APPS = [ 'django.contrib.contenttypes', 'django.contrib.auth', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'mptt', 'cms', 'menus...
schemamigration
<|file_name|>sbcsgroupprober.py<|end_file_name|><|fim▁begin|><|fim▁hole|># The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Mark Pilgrim - port to ...
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. #
<|file_name|>sbcsgroupprober.py<|end_file_name|><|fim▁begin|>######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial De...
def __init__(self): CharSetGroupProber.__init__(self) self._mProbers = [ \ SingleByteCharSetProber(Win1251CyrillicModel), SingleByteCharSetProber(Koi8rModel), SingleByteCharSetProber(Latin5CyrillicModel), SingleByteCharSetProber(MacCyrillicModel), SingleByteCharSetProber(Ibm866Model), SingleByteC...
<|file_name|>sbcsgroupprober.py<|end_file_name|><|fim▁begin|>######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial De...
CharSetGroupProber.__init__(self) self._mProbers = [ \ SingleByteCharSetProber(Win1251CyrillicModel), SingleByteCharSetProber(Koi8rModel), SingleByteCharSetProber(Latin5CyrillicModel), SingleByteCharSetProber(MacCyrillicModel), SingleByteCharSetProber(Ibm866Model), SingleByteCharSetProber(Ibm855Mo...
<|file_name|>sbcsgroupprober.py<|end_file_name|><|fim▁begin|>######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial De...
__init__
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
missing = [ get_gene_id(x["chrom"], x["pos"], x['end'], build=build, verbose=True) for i, x in missing.iterrows() ]
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
""" adds gene symbols to variants lacking them. Args: de_novos: dataframe of de novo variants build: whether to use the 'grch37' or 'grch38' build (default=GRCh37) Returns: pandas Series of HGNC symbols, with additional annotations for many variants previously lacki...
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
""" open url with python libraries Args: url: headers: Returns: tuple of http response, http response code, and http headers """ req = request.Request(url, headers=headers) try: handler = request.urlopen(req) except HTTPError as e: ...
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
""" limit ensembl requests to one per 0.067 s """ global PREV_TIME diff = time.time() - PREV_TIME if diff < rate_limit: time.sleep(rate_limit - diff) PREV_TIME = time.time()
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
"""find the hgnc symbol overlapping a variant position Args: variant: data frame or list for a variant, containing columns named "chrom", "start_pos", and "end_pos" for a single variant build: genome build to find consequences on verbose: flag indicating whether to print...
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
response = response.decode("utf-8")
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
time.sleep(rate_limit - diff)
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
raise ValueError("too many attempts, figure out why its failing")
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
print("chr{0}:{1} {2}".format(chrom, start_pos, ext))
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
if "retry-after" in requested_headers: time.sleep(float(requested_headers["retry-after"])) elif "x-ratelimit-reset" in requested_headers: time.sleep(int(requested_headers["x-ratelimit-reset"])) return get_gene_id(chrom, start_pos, end_pos, build, verbose, attempts)
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
time.sleep(float(requested_headers["retry-after"]))
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
time.sleep(int(requested_headers["x-ratelimit-reset"]))
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
time.sleep(30) return get_gene_id(chrom, start_pos, end_pos, build, verbose, attempts)
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
raise ValueError('Invalid Ensembl response: {0}.\nSubmitted ' 'URL was: {1}{2}\nheaders: {3}\nresponse: {4}'.format(status_code, base_url, ext, requested_headers, response))
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
return json_text[0]["external_name"]
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
fix_missing_gene_symbols
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
open_url
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
rate_limit_requests
<|file_name|>missing_symbols.py<|end_file_name|><|fim▁begin|>""" Copyright (c) 2016 Genome Research Ltd. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limi...
get_gene_id
<|file_name|>datasources.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Feb 24 12:49:36 2017 @author: drsmith """ import os from .globals import FdpError def canonicalMachineName(machine=''): aliases = {'nstxu': ['nstx', 'nstxu', 'nstx-u'], 'diii...
'nstxlogs.sybase_login') }
<|file_name|>datasources.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Feb 24 12:49:36 2017 @author: drsmith """ import os from .globals import FdpError def canonicalMachineName(machine=''): <|fim_middle|> MDS_SERVERS = { 'nstxu': {'hostname': 'skylark....
aliases = {'nstxu': ['nstx', 'nstxu', 'nstx-u'], 'diiid': ['diiid', 'diii-d', 'd3d'], 'cmod': ['cmod', 'c-mod']} for key, value in aliases.items(): if machine.lower() in value: return key # invalid machine name raise FdpError('"{}" is not a valid machine...
<|file_name|>datasources.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Feb 24 12:49:36 2017 @author: drsmith """ import os from .globals import FdpError def canonicalMachineName(machine=''): aliases = {'nstxu': ['nstx', 'nstxu', 'nstx-u'], 'diii...
return key
<|file_name|>datasources.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Feb 24 12:49:36 2017 @author: drsmith """ import os from .globals import FdpError def <|fim_middle|>(machine=''): aliases = {'nstxu': ['nstx', 'nstxu', 'nstx-u'], 'diiid': ['...
canonicalMachineName
<|file_name|>oracle_element.py<|end_file_name|><|fim▁begin|># Copyright 2021 Google LLC # # 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.org/licenses/LICENSE-2.0 # #...
observation is asynchronous. This argument is optional and defaults to
<|file_name|>oracle_element.py<|end_file_name|><|fim▁begin|># Copyright 2021 Google LLC # # 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.org/licenses/LICENSE-2.0 # #...
"""A Reach Oracle configuration class. Attributes: reach_name: The name of the Oracle. task_code: The task code string. intent: The intention of the task. This agument is optional and defaults to an empty string. success_type: The type of success. This argument is optional and defaults ...
<|file_name|>hash_check.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from flask_bcrypt import generate_password_hash # Change the number of rounds (second argument) until it takes between # 0.25 and 0.5 seconds to run. generate_password_hash('password1', 8)<|fim▁end|>
<|file_name|>echem_paperplots.py<|end_file_name|><|fim▁begin|>import time, copy import os, os.path import sys import numpy from PyQt4.QtCore import * from PyQt4.QtGui import * from scipy import optimize from echem_plate_ui import * from echem_plate_math import * import pickle p1='C:/Users/Gregoire/Documents/CaltechWor...
<|file_name|>running_mpi_executables.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python __copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu" __license__ = "MIT" import sys import radical.pilot as rp # READ: The RADICAL-Pilot documentation: # http://radicalpilot.readthedocs.org/en/latest # # Try ...
print "[Callback]: ComputeUnit '%s' state: %s." % (unit.uid, state) if state == rp.FAILED: sys.exit (1)
<|file_name|>running_mpi_executables.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python __copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu" __license__ = "MIT" import sys import radical.pilot as rp # READ: The RADICAL-Pilot documentation: # http://radicalpilot.readthedocs.org/en/latest # # Try ...
""" this callback is invoked on all pilot state changes """ print "[Callback]: ComputePilot '%s' state: %s." % (pilot.uid, state) if state == rp.FAILED: sys.exit (1)
<|file_name|>running_mpi_executables.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python __copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu" __license__ = "MIT" import sys import radical.pilot as rp # READ: The RADICAL-Pilot documentation: # http://radicalpilot.readthedocs.org/en/latest # # Try ...
""" this callback is invoked on all unit state changes """ print "[Callback]: ComputeUnit '%s' state: %s." % (unit.uid, state) if state == rp.FAILED: sys.exit (1)
<|file_name|>running_mpi_executables.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python __copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu" __license__ = "MIT" import sys import radical.pilot as rp # READ: The RADICAL-Pilot documentation: # http://radicalpilot.readthedocs.org/en/latest # # Try ...
sys.exit (1)
<|file_name|>running_mpi_executables.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python __copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu" __license__ = "MIT" import sys import radical.pilot as rp # READ: The RADICAL-Pilot documentation: # http://radicalpilot.readthedocs.org/en/latest # # Try ...
sys.exit (1)
<|file_name|>running_mpi_executables.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python __copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu" __license__ = "MIT" import sys import radical.pilot as rp # READ: The RADICAL-Pilot documentation: # http://radicalpilot.readthedocs.org/en/latest # # Try ...
if len(sys.argv) > 1: session_name = sys.argv[1] else: session_name = None # Create a new session. No need to try/except this: if session creation # fails, there is not much we can do anyways... session = rp.Session(name=session_name) print "session id: %s" % session.uid # ...
<|file_name|>running_mpi_executables.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python __copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu" __license__ = "MIT" import sys import radical.pilot as rp # READ: The RADICAL-Pilot documentation: # http://radicalpilot.readthedocs.org/en/latest # # Try ...
session_name = sys.argv[1]
<|file_name|>running_mpi_executables.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python __copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu" __license__ = "MIT" import sys import radical.pilot as rp # READ: The RADICAL-Pilot documentation: # http://radicalpilot.readthedocs.org/en/latest # # Try ...
session_name = None
<|file_name|>running_mpi_executables.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python __copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu" __license__ = "MIT" import sys import radical.pilot as rp # READ: The RADICAL-Pilot documentation: # http://radicalpilot.readthedocs.org/en/latest # # Try ...
units = [units]
<|file_name|>running_mpi_executables.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python __copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu" __license__ = "MIT" import sys import radical.pilot as rp # READ: The RADICAL-Pilot documentation: # http://radicalpilot.readthedocs.org/en/latest # # Try ...
pilot_state_cb
<|file_name|>running_mpi_executables.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python __copyright__ = "Copyright 2013-2014, http://radical.rutgers.edu" __license__ = "MIT" import sys import radical.pilot as rp # READ: The RADICAL-Pilot documentation: # http://radicalpilot.readthedocs.org/en/latest # # Try ...
unit_state_cb
<|file_name|>test_reference_bind.py<|end_file_name|><|fim▁begin|># Copyright 2017 Virgil Dupras # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from datet...
def test_typical_situation(): # Verify that ReferenceBind.match_entries() return expected entried in a typical situation
<|file_name|>test_reference_bind.py<|end_file_name|><|fim▁begin|># Copyright 2017 Virgil Dupras # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from datet...
txn = Transaction(entry_date, description=description, amount=Amount(1, USD)) split = txn.splits[0] split.reference = reference return Entry(split, split.amount, 0, 0, 0)
<|file_name|>test_reference_bind.py<|end_file_name|><|fim▁begin|># Copyright 2017 Virgil Dupras # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from datet...
plugin = ReferenceBind() DATE = date(2017, 10, 10) existing_entries = list(starmap(create_entry, [ (DATE, 'e1', 'ref1'), (DATE, 'e2', 'ref2'), ])) imported_entries = list(starmap(create_entry, [ (DATE, 'i1', 'ref1'), (DATE, 'i2', 'ref3'), ])) matches = plugin....
<|file_name|>test_reference_bind.py<|end_file_name|><|fim▁begin|># Copyright 2017 Virgil Dupras # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from datet...
plugin = ReferenceBind() DATE = date(2017, 10, 10) existing = create_entry(DATE, 'e1', 'ref1') existing.split.reconciliation_date = DATE imported = create_entry(DATE, 'i1', 'ref1') matches = plugin.match_entries(None, None, None, [existing], [imported]) EXPECTED = [('e1', 'i1', False, 0.99)]...
<|file_name|>test_reference_bind.py<|end_file_name|><|fim▁begin|># Copyright 2017 Virgil Dupras # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from datet...
plugin = ReferenceBind() DATE = date(2017, 10, 10) existing_entries = list(starmap(create_entry, [ (DATE, 'e1', 'ref1'), ])) imported_entries = list(starmap(create_entry, [ (DATE, 'i1', 'ref1'), (DATE, 'i2', 'ref1'), ])) matches = plugin.match_entries(None, None, None...
<|file_name|>test_reference_bind.py<|end_file_name|><|fim▁begin|># Copyright 2017 Virgil Dupras # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from datet...
create_entry
<|file_name|>test_reference_bind.py<|end_file_name|><|fim▁begin|># Copyright 2017 Virgil Dupras # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from datet...
test_typical_situation
<|file_name|>test_reference_bind.py<|end_file_name|><|fim▁begin|># Copyright 2017 Virgil Dupras # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from datet...
test_reconciled_entry
<|file_name|>test_reference_bind.py<|end_file_name|><|fim▁begin|># Copyright 2017 Virgil Dupras # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-3.0.html from datet...
test_match_first_only
<|file_name|>fm_demod.py<|end_file_name|><|fim▁begin|># # Copyright 2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; e...
@type sample_rate: integer @param audio_decim: input to output decimation rate @type audio_decim: integer """
<|file_name|>fm_demod.py<|end_file_name|><|fim▁begin|># # Copyright 2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; e...
""" Generalized FM demodulation block with deemphasis and audio filtering. This block demodulates a band-limited, complex down-converted FM channel into the the original baseband signal, optionally applying deemphasis. Low pass filtering is done on the resultant signal. It produces an out...
<|file_name|>fm_demod.py<|end_file_name|><|fim▁begin|># # Copyright 2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; e...
gr.hier_block2.__init__(self, "fm_demod_cf", gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature gr.io_signature(1, 1, gr.sizeof_float)) # Output signature k = channel_rate/(2*pi*deviation) QUAD = gr.quadrature_demod_cf(k) audio_taps = optfir.low_pass(gain, # Filter gain ...
<|file_name|>fm_demod.py<|end_file_name|><|fim▁begin|># # Copyright 2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; e...
""" NBFM demodulation block, 20 KHz channels This block demodulates a complex, downconverted, narrowband FM channel conforming to 20K0F3E emission standards, outputting floats in the range [-1.0, +1.0]. @param sample_rate: incoming sample rate of the FM baseband @type sample_rate: in...
<|file_name|>fm_demod.py<|end_file_name|><|fim▁begin|># # Copyright 2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; e...
fm_demod_cf.__init__(self, channel_rate, audio_decim, 5000, # Deviation 3000, # Audio passband frequency 4500) # Audio stopband frequency
<|file_name|>fm_demod.py<|end_file_name|><|fim▁begin|># # Copyright 2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; e...
""" WFM demodulation block, mono. This block demodulates a complex, downconverted, wideband FM channel conforming to 200KF3E emission standards, outputting floats in the range [-1.0, +1.0]. @param sample_rate: incoming sample rate of the FM baseband @type sample_rate: integer @p...
<|file_name|>fm_demod.py<|end_file_name|><|fim▁begin|># # Copyright 2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; e...
fm_demod_cf.__init__(self, channel_rate, audio_decim, 75000, # Deviation 15000, # Audio passband 16000, # Audio stopband 20.0) # Audio gain
<|file_name|>fm_demod.py<|end_file_name|><|fim▁begin|># # Copyright 2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; e...
DEEMPH = fm_deemph(channel_rate, tau) self.connect(self, QUAD, DEEMPH, LPF, self)
<|file_name|>fm_demod.py<|end_file_name|><|fim▁begin|># # Copyright 2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; e...
self.connect(self, QUAD, LPF, self)
<|file_name|>fm_demod.py<|end_file_name|><|fim▁begin|># # Copyright 2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; e...
__init__
<|file_name|>fm_demod.py<|end_file_name|><|fim▁begin|># # Copyright 2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; e...
__init__
<|file_name|>fm_demod.py<|end_file_name|><|fim▁begin|># # Copyright 2006,2007 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; e...
__init__
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from click_plugins import with_plugins from pkg_resources import iter_entry_points import click <|fim▁hole|> context_settings=dict(help_option_names=['-h', '--help'])) @click.version_option(message='%(version)s') def main(): pass<|fim▁end|>
@with_plugins(iter_entry_points('girder.cli_plugins')) @click.group(help='Girder: data management platform for the web.',
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from click_plugins import with_plugins from pkg_resources import iter_entry_points import click @with_plugins(iter_entry_points('girder.cli_plugins')) @click.group(help='Girder: data management platform for the web.', context_settings=dict(help_option...
pass
<|file_name|>__init__.py<|end_file_name|><|fim▁begin|>from click_plugins import with_plugins from pkg_resources import iter_entry_points import click @with_plugins(iter_entry_points('girder.cli_plugins')) @click.group(help='Girder: data management platform for the web.', context_settings=dict(help_option...
main
<|file_name|>testkmeans.py<|end_file_name|><|fim▁begin|>"""Run tests for the kmeans portion of the kmeans module""" import kmeans.kmeans.kmeans as kmeans import numpy as np import random def test_1dim_distance(): """See if this contraption works in 1 dimension""" num1 = random.random() num2 = random.rand...
def test_random_centroid_dimensions(): """ensure the correct number of dimensions"""
<|file_name|>testkmeans.py<|end_file_name|><|fim▁begin|>"""Run tests for the kmeans portion of the kmeans module""" import kmeans.kmeans.kmeans as kmeans import numpy as np import random def test_1dim_distance(): <|fim_middle|> def test_ndim_distance(): """Test to see if changing val by 1 does what it oug...
"""See if this contraption works in 1 dimension""" num1 = random.random() num2 = random.random() assert kmeans.ndim_euclidean_distance(num1, num2) == abs(num1-num2)
<|file_name|>testkmeans.py<|end_file_name|><|fim▁begin|>"""Run tests for the kmeans portion of the kmeans module""" import kmeans.kmeans.kmeans as kmeans import numpy as np import random def test_1dim_distance(): """See if this contraption works in 1 dimension""" num1 = random.random() num2 = random.rand...
"""Test to see if changing val by 1 does what it ought to do convert to float to integer because floating arithmetic makes testing analytic functions a mess""" rand = random.random point1 = [rand(), rand(), rand(), rand(), rand(), rand()] point2 = [point1[0]+1] + point1[1:] # just shift x to the...
<|file_name|>testkmeans.py<|end_file_name|><|fim▁begin|>"""Run tests for the kmeans portion of the kmeans module""" import kmeans.kmeans.kmeans as kmeans import numpy as np import random def test_1dim_distance(): """See if this contraption works in 1 dimension""" num1 = random.random() num2 = random.rand...
"""ensure the iteration ceiling works""" # assert kmeans.should_iter([], [], iterations=29) == True assert kmeans.should_iter([], [], iterations=30) == False assert kmeans.should_iter([], [], iterations=31) == False
<|file_name|>testkmeans.py<|end_file_name|><|fim▁begin|>"""Run tests for the kmeans portion of the kmeans module""" import kmeans.kmeans.kmeans as kmeans import numpy as np import random def test_1dim_distance(): """See if this contraption works in 1 dimension""" num1 = random.random() num2 = random.rand...
"""ensure the correct number of dimensions""" dimensions = random.randrange(1, 100) k = random.randrange(1, 100) centroids = kmeans.random_centroids(k, dimensions) for centroid in centroids: assert len(centroid) == dimensions
<|file_name|>testkmeans.py<|end_file_name|><|fim▁begin|>"""Run tests for the kmeans portion of the kmeans module""" import kmeans.kmeans.kmeans as kmeans import numpy as np import random def test_1dim_distance(): """See if this contraption works in 1 dimension""" num1 = random.random() num2 = random.rand...
"""ensure that the average across each dimension is returned""" new_centroid = kmeans.iterated_centroid([[1, 1, 1], [2, 2, 2]],\ [[100, 200, 300]], [(0, 0), (1, 0)]) np.testing.assert_allclose(new_centroid, np.array([[1.5, 1.5, 1.5]]),\ rtol=1e-5)
<|file_name|>testkmeans.py<|end_file_name|><|fim▁begin|>"""Run tests for the kmeans portion of the kmeans module""" import kmeans.kmeans.kmeans as kmeans import numpy as np import random def <|fim_middle|>(): """See if this contraption works in 1 dimension""" num1 = random.random() num2 = random.random()...
test_1dim_distance
<|file_name|>testkmeans.py<|end_file_name|><|fim▁begin|>"""Run tests for the kmeans portion of the kmeans module""" import kmeans.kmeans.kmeans as kmeans import numpy as np import random def test_1dim_distance(): """See if this contraption works in 1 dimension""" num1 = random.random() num2 = random.rand...
test_ndim_distance
<|file_name|>testkmeans.py<|end_file_name|><|fim▁begin|>"""Run tests for the kmeans portion of the kmeans module""" import kmeans.kmeans.kmeans as kmeans import numpy as np import random def test_1dim_distance(): """See if this contraption works in 1 dimension""" num1 = random.random() num2 = random.rand...
test_maxiters
<|file_name|>testkmeans.py<|end_file_name|><|fim▁begin|>"""Run tests for the kmeans portion of the kmeans module""" import kmeans.kmeans.kmeans as kmeans import numpy as np import random def test_1dim_distance(): """See if this contraption works in 1 dimension""" num1 = random.random() num2 = random.rand...
test_random_centroid_dimensions
<|file_name|>testkmeans.py<|end_file_name|><|fim▁begin|>"""Run tests for the kmeans portion of the kmeans module""" import kmeans.kmeans.kmeans as kmeans import numpy as np import random def test_1dim_distance(): """See if this contraption works in 1 dimension""" num1 = random.random() num2 = random.rand...
test_iterated_centroid
<|file_name|>src.py<|end_file_name|><|fim▁begin|>from itertools import permutations import re def create_formula(combination,numbers): formula = "" index = 0 for op in combination: formula += str(numbers[index]) + op index += 1 formula += numbers[index] return formula ''' Unnece...
for formula in countdown(line.split(" ")): out.write(formula) out.write("\n") out.write("\n\n")
<|file_name|>src.py<|end_file_name|><|fim▁begin|>from itertools import permutations import re def create_formula(combination,numbers): <|fim_middle|> ''' Unnecessary Funtion ''' def evaluate(form): result = 0 for index in range(len(form)): if form[index] == "+": result += int(form[...
formula = "" index = 0 for op in combination: formula += str(numbers[index]) + op index += 1 formula += numbers[index] return formula
<|file_name|>src.py<|end_file_name|><|fim▁begin|>from itertools import permutations import re def create_formula(combination,numbers): formula = "" index = 0 for op in combination: formula += str(numbers[index]) + op index += 1 formula += numbers[index] return formula ''' Unnece...
result = 0 for index in range(len(form)): if form[index] == "+": result += int(form[index+1]) index += 1 elif form[index] == "-": result -= int(form[index+1]) index += 1 elif form[index] == "*": result *= int(form[index+1]) ...