uid
stringlengths
24
24
split
stringclasses
1 value
category
stringclasses
2 values
content
stringlengths
5
482k
signature
stringlengths
1
14k
suffix
stringlengths
1
482k
prefix
stringlengths
9
14k
prefix_token_count
int64
3
5.01k
prefix_token_budget
int64
64
256
element_token_count
int64
1
292k
signature_token_count
int64
1
5.01k
prefix_context_token_count
int64
0
255
repo
stringlengths
7
112
path
stringlengths
4
208
language
stringclasses
1 value
name
stringlengths
1
218
qualname
stringlengths
1
218
start_line
int64
1
26.7k
end_line
int64
1
26.7k
signature_start_line
int64
1
26.7k
signature_end_line
int64
1
26.7k
source_hash
stringlengths
40
40
source_dataset
stringclasses
1 value
source_split
stringclasses
1 value
d6edb4a61c4afcb723bbd3bc
train
function
def main(): app = QtWidgets.QApplication(sys.argv) StartWindow = QtWidgets.QMainWindow() ui = Ui_StartWindow() ui.setupUi(StartWindow) StartWindow.show() sys.exit(app.exec_())
def main():
app = QtWidgets.QApplication(sys.argv) StartWindow = QtWidgets.QMainWindow() ui = Ui_StartWindow() ui.setupUi(StartWindow) StartWindow.show() sys.exit(app.exec_())
def __init__(self): self.sides = [1, 2, 3, 4, 5, 6] def roll(self): """ Rolls a number from the sides of the die""" from random import choice as roll return roll(self.sides) def main():
64
64
49
3
61
james20023355/GipGame
game/gip.py
Python
main
main
749
755
749
749
01d9e9275a50b577447188cfde7bbc501d135f2e
bigcode/the-stack
train
7efadc2b19c7ea7921721988
train
class
class Ui_PlayerEntryWindow(object): """ This Window is a form that gets the player's Name""" def setupUi(self, PlayerEntryWindow): PlayerEntryWindow.setObjectName("PlayerEntryWindow") PlayerEntryWindow.resize(245, 280) PlayerEntryWindow.setWindowTitle("GipGame") self.centralwidge...
class Ui_PlayerEntryWindow(object):
""" This Window is a form that gets the player's Name""" def setupUi(self, PlayerEntryWindow): PlayerEntryWindow.setObjectName("PlayerEntryWindow") PlayerEntryWindow.resize(245, 280) PlayerEntryWindow.setWindowTitle("GipGame") self.centralwidget = QtWidgets.QWidget(PlayerEntryWin...
Btn.setAutoDefault(False) self.playBtn.setObjectName("playBtn") StartWindow.setCentralWidget(self.centralwidget) self.menubar = QtWidgets.QMenuBar(StartWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 597, 21)) self.menubar.setObjectName("menubar") StartWindow.setMenuB...
256
256
1,011
7
249
james20023355/GipGame
game/gip.py
Python
Ui_PlayerEntryWindow
Ui_PlayerEntryWindow
123
207
123
123
86ec0988b11754a72f0f6ccb74fb17d9ab3266c6
bigcode/the-stack
train
fd6ab367afc80d59dfef8425
train
class
class Dice: """ This class is to represent a real world dice """ def __init__(self): self.sides = [1, 2, 3, 4, 5, 6] def roll(self): """ Rolls a number from the sides of the die""" from random import choice as roll return roll(self.sides)
class Dice:
""" This class is to represent a real world dice """ def __init__(self): self.sides = [1, 2, 3, 4, 5, 6] def roll(self): """ Rolls a number from the sides of the die""" from random import choice as roll return roll(self.sides)
lyPlaying = False self.turnScore = 0 def isWinner(self, player): """ This Method returns a boolean value based on whether or not a player has reached 100 points""" if player.score >= 100: return True else: return False class Dice:
64
64
77
3
60
james20023355/GipGame
game/gip.py
Python
Dice
Dice
737
745
737
737
cf173ef0f8d55d8a2ded3ce02d4e93dfba0bf9e9
bigcode/the-stack
train
0dae3e486b4520804aab1761
train
class
class B2AccessIntegrationOAuth2(B2AccessOAuth2): name = 'b2access-test' ACCESS_TOKEN_URL = 'https://b2access-integration.fz-juelich.de/oauth2/token' USERINFO_URL = 'https://b2access-integration.fz-juelich.de/oauth2/userinfo' AUTHORIZATION_URL = 'https://b2access-integration.fz-juelich.de/oauth2-as/oauth...
class B2AccessIntegrationOAuth2(B2AccessOAuth2):
name = 'b2access-test' ACCESS_TOKEN_URL = 'https://b2access-integration.fz-juelich.de/oauth2/token' USERINFO_URL = 'https://b2access-integration.fz-juelich.de/oauth2/userinfo' AUTHORIZATION_URL = 'https://b2access-integration.fz-juelich.de/oauth2-as/oauth2-authz'
.USERINFO_URL, headers={'Authorization': 'Bearer ' + access_token}, ) def refresh_token(self, *args, **kwargs): raise NotImplementedError( 'Refresh tokens for B2ACCESS have not been implemented' ) class B2AccessIntegrationOAuth2(B2AccessOAuth2):
64
64
96
13
51
hmpf/social-auth-backend-b2access
src/b2access.py
Python
B2AccessIntegrationOAuth2
B2AccessIntegrationOAuth2
46
50
46
46
2ea51265f27f24b571d06278cbc0b831e24fe55c
bigcode/the-stack
train
a7559fc2df7372da29da1b7b
train
class
class B2AccessOAuth2(BaseOAuth2): name = 'b2access' REQUIRES_EMAIL_VALIDATION = False DEFAULT_SCOPE = ['profile', 'email'] ACCESS_TOKEN_METHOD = 'POST' ACCESS_TOKEN_URL = 'https://b2access.eudat.eu/oauth2/token' USERINFO_URL = 'https://b2access.eudat.eu/oauth2/userinfo' AUTHORIZATION_URL = '...
class B2AccessOAuth2(BaseOAuth2):
name = 'b2access' REQUIRES_EMAIL_VALIDATION = False DEFAULT_SCOPE = ['profile', 'email'] ACCESS_TOKEN_METHOD = 'POST' ACCESS_TOKEN_URL = 'https://b2access.eudat.eu/oauth2/token' USERINFO_URL = 'https://b2access.eudat.eu/oauth2/userinfo' AUTHORIZATION_URL = 'https://b2access.eudat.eu/oauth2-a...
from social_core.backends.oauth import BaseOAuth2 class B2AccessOAuth2(BaseOAuth2):
20
96
322
10
9
hmpf/social-auth-backend-b2access
src/b2access.py
Python
B2AccessOAuth2
B2AccessOAuth2
4
43
4
4
03405841567208f4f8336d15a7cd8b411981731f
bigcode/the-stack
train
7c562c418d8618b5a61b8424
train
class
class SchemaStore: def __init__(self) -> None: self._listeners = WeakSet() # type: WeakSet[StoreListener] self._schema_list = [] # type: List[Dict] self._schema_uri_to_content = {} # type: Dict[str, str] self._schemas_loaded = False self._watched_settings = [] # type: Lis...
class SchemaStore:
def __init__(self) -> None: self._listeners = WeakSet() # type: WeakSet[StoreListener] self._schema_list = [] # type: List[Dict] self._schema_uri_to_content = {} # type: Dict[str, str] self._schemas_loaded = False self._watched_settings = [] # type: List[sublime.Settings]...
from abc import ABCMeta, abstractmethod from LSP.plugin import DottedDict from LSP.plugin import Notification from LSP.plugin.core.typing import Any, Callable, Dict, List, Optional, Tuple from lsp_utils import ApiWrapperInterface from lsp_utils import request_handler from lsp_utils import NpmClientHandler from os impor...
168
256
1,401
4
163
Sublime-Instincts/LSP-json
plugin.py
Python
SchemaStore
SchemaStore
32
171
32
32
60e03b2c177c10a1572178b66a717b5752d00177
bigcode/the-stack
train
75639a6593e18db7ae9dea60
train
function
def plugin_unloaded(): LspJSONPlugin.cleanup()
def plugin_unloaded():
LspJSONPlugin.cleanup()
request_handler from lsp_utils import NpmClientHandler from os import path from sublime_lib import ResourcePath from urllib.parse import quote from weakref import WeakSet import re import sublime import sublime_plugin def plugin_loaded(): LspJSONPlugin.setup() def plugin_unloaded():
64
64
12
5
59
Sublime-Instincts/LSP-json
plugin.py
Python
plugin_unloaded
plugin_unloaded
21
22
21
21
6bec6f1984d6d6269ea109bdaea11fbd5dd9eb5e
bigcode/the-stack
train
b2e63719f05484b0cc940b2e
train
class
class StoreListener(metaclass=ABCMeta): @abstractmethod def on_store_changed(self, schemas: List[Dict]) -> None: pass
class StoreListener(metaclass=ABCMeta): @abstractmethod
def on_store_changed(self, schemas: List[Dict]) -> None: pass
ResourcePath from urllib.parse import quote from weakref import WeakSet import re import sublime import sublime_plugin def plugin_loaded(): LspJSONPlugin.setup() def plugin_unloaded(): LspJSONPlugin.cleanup() class StoreListener(metaclass=ABCMeta): @abstractmethod
64
64
34
15
49
Sublime-Instincts/LSP-json
plugin.py
Python
StoreListener
StoreListener
25
29
25
27
f3cdffc0b2952b8fc451f66ad9453026ec92412a
bigcode/the-stack
train
be242bccbfa1e55f3484b275
train
class
class LspJsonAutoCompleteCommand(sublime_plugin.TextCommand): def run(self, _: sublime.Edit) -> None: self.view.run_command("insert_snippet", {"contents": "\"$0\""}) # Do auto-complete one tick later, otherwise LSP is not up-to-date with # the incremental text sync. sublime.set_timeo...
class LspJsonAutoCompleteCommand(sublime_plugin.TextCommand):
def run(self, _: sublime.Edit) -> None: self.view.run_command("insert_snippet", {"contents": "\"$0\""}) # Do auto-complete one tick later, otherwise LSP is not up-to-date with # the incremental text sync. sublime.set_timeout(lambda: self.view.run_command("auto_complete"))
'] = 'jsonc' # --- StoreListener ------------------------------------------------------------------------------------------------ def on_store_changed(self, schemas: List[Dict]) -> None: self._api.send_notification('json/schemaAssociations', [schemas + self._user_schemas]) class LspJsonAutoCompleteCom...
64
64
85
14
50
Sublime-Instincts/LSP-json
plugin.py
Python
LspJsonAutoCompleteCommand
LspJsonAutoCompleteCommand
230
235
230
230
2af349747bf27dbdd06bb6a98063be849c9a6ead
bigcode/the-stack
train
d5a5b6d4e83b0fcc862a9485
train
class
class LspJSONPlugin(NpmClientHandler, StoreListener): package_name = __package__ server_directory = 'language-server' server_binary_path = path.join( server_directory, 'node_modules', 'vscode-json-languageserver', 'out', 'node', 'jsonServerMain.js', ) ...
class LspJSONPlugin(NpmClientHandler, StoreListener):
package_name = __package__ server_directory = 'language-server' server_binary_path = path.join( server_directory, 'node_modules', 'vscode-json-languageserver', 'out', 'node', 'jsonServerMain.js', ) _schema_store = SchemaStore() @classmethod de...
_uri}]) def _parse_schema(self, resource: ResourcePath) -> Any: try: return sublime.decode_value(resource.read_text()) except Exception: print('Failed parsing schema "{}"'.format(resource.file_path())) return None def _register_schemas(self, schemas: List[An...
162
162
540
13
149
Sublime-Instincts/LSP-json
plugin.py
Python
LspJSONPlugin
LspJSONPlugin
174
227
174
174
b3759db91581f2a380284a5e1a3ab39a0497a69a
bigcode/the-stack
train
a1653d73a9ee201fc34e3d4d
train
function
def plugin_loaded(): LspJSONPlugin.setup()
def plugin_loaded():
LspJSONPlugin.setup()
sp_utils import ApiWrapperInterface from lsp_utils import request_handler from lsp_utils import NpmClientHandler from os import path from sublime_lib import ResourcePath from urllib.parse import quote from weakref import WeakSet import re import sublime import sublime_plugin def plugin_loaded():
64
64
11
4
59
Sublime-Instincts/LSP-json
plugin.py
Python
plugin_loaded
plugin_loaded
17
18
17
17
1f08479652afdc69d5262fe5de3aa04205dac13e
bigcode/the-stack
train
02481d85215084ef554e9ec8
train
function
def banner(txt=None, c="#", debug=True): """prints a banner of the form with a frame of # arround the txt:: ############################ # txt ############################ . :param txt: a text message to be printed :type txt: string :param c: the character used instead of c ...
def banner(txt=None, c="#", debug=True):
"""prints a banner of the form with a frame of # arround the txt:: ############################ # txt ############################ . :param txt: a text message to be printed :type txt: string :param c: the character used instead of c :type c: character """ if debug: ...
choice = choice.strip().lower() if choice in ['y', 'yes']: return True elif choice in ['n', 'no', 'q']: return False else: print("Invalid input...") tries -= 1 def banner(txt=None, c="#", debug=True):
64
64
121
11
52
zaber-paul/base
cloudmesh_base/util.py
Python
banner
banner
76
95
76
76
a886981847ca4b76cc39d219cb5bf547fa2bd3d9
bigcode/the-stack
train
fd49884dabfa1d66e0149b35
train
function
def copy_files(files_glob, source_dir, dest_dir): """ :param files_glob: *.yaml :param source_dir: source directiry :param dest_dir: destination directory :return: """ files = glob.iglob(os.path.join(source_dir, files_glob)) for file in files: if os.path.isfile(file): ...
def copy_files(files_glob, source_dir, dest_dir):
""" :param files_glob: *.yaml :param source_dir: source directiry :param dest_dir: destination directory :return: """ files = glob.iglob(os.path.join(source_dir, files_glob)) for file in files: if os.path.isfile(file): shutil.copy2(file, dest_dir)
except: file_content = "" setup_requirements = '\n'.join(requirements) if setup_requirements != file_content: with open("requirements.txt", "w") as text_file: text_file.write(setup_requirements) def copy_files(files_glob, source_dir, dest_dir):
64
64
89
13
51
zaber-paul/base
cloudmesh_base/util.py
Python
copy_files
copy_files
191
202
191
191
6ed0fd8d6897d6f24de19c62bc4f1a6432dc8db4
bigcode/the-stack
train
976693bfc6b8ad31b2fb77ef
train
function
def readfile(filename): with open(path_expand(filename), 'r') as f: content = f.read() return content
def readfile(filename):
with open(path_expand(filename), 'r') as f: content = f.read() return content
files_glob)) for file in files: if os.path.isfile(file): shutil.copy2(file, dest_dir) def dict_replace(content, replacements={}): for key in replacements: content = content.replace("\{key\}".format(replacements[key])) return content def readfile(filename):
64
64
28
5
58
zaber-paul/base
cloudmesh_base/util.py
Python
readfile
readfile
212
215
212
212
8d358ff594a7a5c4c3bb1e3e8dcbb06131975733
bigcode/the-stack
train
342d275453cbdb4b8a858b46
train
function
def yn_choice(message, default='y', tries=None): """asks for a yes/no question. :param message: the message containing the question :param default: the default answer """ # http://stackoverflow.com/questions/3041986/python-command-line-yes-no-input""" choices = 'Y/n' if default.lower() in ('y', ...
def yn_choice(message, default='y', tries=None):
"""asks for a yes/no question. :param message: the message containing the question :param default: the default answer """ # http://stackoverflow.com/questions/3041986/python-command-line-yes-no-input""" choices = 'Y/n' if default.lower() in ('y', 'yes') else 'y/N' if tries is None: c...
): return str(data) elif isinstance(data, collections.Mapping): return dict(list(map(convert_from_unicode, iter(data.items())))) elif isinstance(data, collections.Iterable): return type(data)(list(map(convert_from_unicode, data))) else: return data def yn_choice(message, defa...
69
69
233
12
56
zaber-paul/base
cloudmesh_base/util.py
Python
yn_choice
yn_choice
51
73
51
51
2adba5fb717669db994ee6441fadc698725334c5
bigcode/the-stack
train
cd26b368002daed14505dce2
train
function
def backup_name(filename): """ :param filename: given a filename creates a backup name of the form filename.bak.1. If the filename already exists the number will be increased as much as needed so the file does not exist in the given location. ...
def backup_name(filename):
""" :param filename: given a filename creates a backup name of the form filename.bak.1. If the filename already exists the number will be increased as much as needed so the file does not exist in the given location. The filenam...
useful for nosetests to better distinguish them. :param txt: a text message to be printed :type txt: string """ if txt is None: txt = inspect.getouterframes(inspect.currentframe())[1][3] banner(txt) def backup_name(filename):
64
64
154
5
59
zaber-paul/base
cloudmesh_base/util.py
Python
backup_name
backup_name
137
156
137
137
9c882253b2a5a2345f71e1f83513e0810cfd9614
bigcode/the-stack
train
3c5e401e6d87e502cc3160fd
train
function
def auto_create_version(class_name, version, filename="__init__.py"): version_filename = "{0}/{1}".format(class_name, filename) with open(version_filename, "r") as f: content = f.read() if content != '__version__ = "{0}"'.format(version): banner("Updating version to {0}".format(version)) ...
def auto_create_version(class_name, version, filename="__init__.py"):
version_filename = "{0}/{1}".format(class_name, filename) with open(version_filename, "r") as f: content = f.read() if content != '__version__ = "{0}"'.format(version): banner("Updating version to {0}".format(version)) with open(version_filename, "w") as text_file: text_...
found = True backup = None while found: n += 1 backup = "{0}.bak.{1}".format(location, n) found = os.path.isfile(backup) return backup def auto_create_version(class_name, version, filename="__init__.py"):
64
64
107
16
47
zaber-paul/base
cloudmesh_base/util.py
Python
auto_create_version
auto_create_version
159
167
159
159
c35d6b29c644a8600a0ae699be8b7d9d389170cb
bigcode/the-stack
train
d4f8376359536059f4dbf66b
train
function
def auto_create_requirements(requirements): """ creates a requirement.txt file form the requirements in the list. If the file exists, it get changed only if the requirements in the list are different from the existing file :param requirements: the requirements in a list """ banner("Creating req...
def auto_create_requirements(requirements):
""" creates a requirement.txt file form the requirements in the list. If the file exists, it get changed only if the requirements in the list are different from the existing file :param requirements: the requirements in a list """ banner("Creating requirements.txt file") try: with o...
content != '__version__ = "{0}"'.format(version): banner("Updating version to {0}".format(version)) with open(version_filename, "w") as text_file: text_file.write(u'__version__ = "{0:s}"'.format(version)) def auto_create_requirements(requirements):
64
64
143
8
56
zaber-paul/base
cloudmesh_base/util.py
Python
auto_create_requirements
auto_create_requirements
170
188
170
170
dc16139b3fbc0b96ef864627fec3f7f7181a100e
bigcode/the-stack
train
5c6005bee84d9147c66a3eac
train
function
def path_expand(text): """ returns a string with expanded variable. :param text: the path to be expanded, which can include ~ and $ variables :param text: string """ template = Template(text) result = template.substitute(os.environ) result = os.path.expanduser(result) return result
def path_expand(text):
""" returns a string with expanded variable. :param text: the path to be expanded, which can include ~ and $ variables :param text: string """ template = Template(text) result = template.substitute(os.environ) result = os.path.expanduser(result) return result
grep that returns the first matching line in a file. String matching only, does not do REs as currently implemented. """ try: return next((L for L in open(filename) if L.find(pattern) >= 0)) except StopIteration: return '' def path_expand(text):
63
64
70
5
58
zaber-paul/base
cloudmesh_base/util.py
Python
path_expand
path_expand
27
37
27
27
98504ad3f7aacf49bbb073543d966eff8a682a17
bigcode/the-stack
train
d473a80e5b1029a29f8e6992
train
function
def convert_from_unicode(data): if isinstance(data, basestring): return str(data) elif isinstance(data, collections.Mapping): return dict(list(map(convert_from_unicode, iter(data.items())))) elif isinstance(data, collections.Iterable): return type(data)(list(map(convert_from_unicode,...
def convert_from_unicode(data):
if isinstance(data, basestring): return str(data) elif isinstance(data, collections.Mapping): return dict(list(map(convert_from_unicode, iter(data.items())))) elif isinstance(data, collections.Iterable): return type(data)(list(map(convert_from_unicode, data))) else: retur...
variable. :param text: the path to be expanded, which can include ~ and $ variables :param text: string """ template = Template(text) result = template.substitute(os.environ) result = os.path.expanduser(result) return result def convert_from_unicode(data):
64
64
70
6
57
zaber-paul/base
cloudmesh_base/util.py
Python
convert_from_unicode
convert_from_unicode
40
48
40
40
787b85ae2001c72b81f8bf7fc478d9a0657fca20
bigcode/the-stack
train
df615c5b6e7e1a9d150e4c31
train
function
def dict_replace(content, replacements={}): for key in replacements: content = content.replace("\{key\}".format(replacements[key])) return content
def dict_replace(content, replacements={}):
for key in replacements: content = content.replace("\{key\}".format(replacements[key])) return content
iry :param dest_dir: destination directory :return: """ files = glob.iglob(os.path.join(source_dir, files_glob)) for file in files: if os.path.isfile(file): shutil.copy2(file, dest_dir) def dict_replace(content, replacements={}):
64
64
33
8
56
zaber-paul/base
cloudmesh_base/util.py
Python
dict_replace
dict_replace
205
209
205
205
8133a71954c162ba8c2b791615042f4e70484593
bigcode/the-stack
train
01dde1e3e2a63d644c7e3edc
train
function
def writefile(filename, content): outfile = open(path_expand(filename), 'w') outfile.write(content) outfile.close()
def writefile(filename, content):
outfile = open(path_expand(filename), 'w') outfile.write(content) outfile.close()
, replacements={}): for key in replacements: content = content.replace("\{key\}".format(replacements[key])) return content def readfile(filename): with open(path_expand(filename), 'r') as f: content = f.read() return content def writefile(filename, content):
64
64
27
7
56
zaber-paul/base
cloudmesh_base/util.py
Python
writefile
writefile
218
221
218
218
1f9d44f4301eb8d87e0933de30f602b6729ee1d1
bigcode/the-stack
train
57783e20ab4ed5b7a4ca9d13
train
function
def HEADING(txt=None): """ Prints a message to stdout with #### surrounding it. This is useful for nosetests to better distinguish them. :param txt: a text message to be printed :type txt: string """ if txt is None: txt = inspect.getouterframes(inspect.currentframe())[1][3] ban...
def HEADING(txt=None):
""" Prints a message to stdout with #### surrounding it. This is useful for nosetests to better distinguish them. :param txt: a text message to be printed :type txt: string """ if txt is None: txt = inspect.getouterframes(inspect.currentframe())[1][3] banner(txt)
if debug: str += "\n" str += "# " + 70 * c if txt is not None: str += "# " + txt str += "# " + 70 * c return str # noinspection PyPep8Naming def HEADING(txt=None):
64
64
80
6
57
zaber-paul/base
cloudmesh_base/util.py
Python
HEADING
HEADING
123
134
123
123
4c1d7d1fee2451fbfff9bd94d9b542a908c4ec6a
bigcode/the-stack
train
3b7f6d32518ef90a450b13de
train
function
def check_python(): python_version = sys.version_info[:3] v_string = [str(i) for i in python_version] python_version_s = '.'.join(v_string) if (python_version[0] == 2) and (python_version[1] >= 7) and (python_version[2] >= 9): print("You are running a supported version of python: {:}".format(...
def check_python():
python_version = sys.version_info[:3] v_string = [str(i) for i in python_version] python_version_s = '.'.join(v_string) if (python_version[0] == 2) and (python_version[1] >= 7) and (python_version[2] >= 9): print("You are running a supported version of python: {:}".format(python_version_s)) ...
(content) outfile.close() def get_python(): python_version = sys.version_info[:3] v_string = [str(i) for i in python_version] python_version_s = '.'.join(v_string) pip_version = pip.__version__ return python_version_s, pip_version def check_python():
66
66
221
4
61
zaber-paul/base
cloudmesh_base/util.py
Python
check_python
check_python
233
253
233
233
62407e4390abfa4a47715f197a0d2ef6149259d9
bigcode/the-stack
train
365bbef97be5cc382639157c
train
function
def get_python(): python_version = sys.version_info[:3] v_string = [str(i) for i in python_version] python_version_s = '.'.join(v_string) pip_version = pip.__version__ return python_version_s, pip_version
def get_python():
python_version = sys.version_info[:3] v_string = [str(i) for i in python_version] python_version_s = '.'.join(v_string) pip_version = pip.__version__ return python_version_s, pip_version
])) return content def readfile(filename): with open(path_expand(filename), 'r') as f: content = f.read() return content def writefile(filename, content): outfile = open(path_expand(filename), 'w') outfile.write(content) outfile.close() def get_python():
64
64
56
4
60
zaber-paul/base
cloudmesh_base/util.py
Python
get_python
get_python
224
230
224
224
410ee57be9d5ce044a4c3802c64da3a9d4d85de8
bigcode/the-stack
train
4766e4a5d768d275f845240f
train
function
def str_banner(txt=None, c="#", debug=True): """prints a banner of the form with a frame of # arround the txt:: ############################ # txt ############################ . :param txt: a text message to be printed :type txt: string :param c: the character used instead of c ...
def str_banner(txt=None, c="#", debug=True):
"""prints a banner of the form with a frame of # arround the txt:: ############################ # txt ############################ . :param txt: a text message to be printed :type txt: string :param c: the character used instead of c :type c: character """ str = "" ...
used instead of c :type c: character """ if debug: print() print("#", 70 * c) if txt is not None: print("#", txt) print("#", 70 * c) def str_banner(txt=None, c="#", debug=True):
64
64
139
12
52
zaber-paul/base
cloudmesh_base/util.py
Python
str_banner
str_banner
98
119
98
98
5651af74d8afc908992993c0439e294aad3d63a9
bigcode/the-stack
train
974e5ba333ad2056ed4a35a8
train
function
def grep(pattern, filename): """Very simple grep that returns the first matching line in a file. String matching only, does not do REs as currently implemented. """ try: return next((L for L in open(filename) if L.find(pattern) >= 0)) except StopIteration: return ''
def grep(pattern, filename):
"""Very simple grep that returns the first matching line in a file. String matching only, does not do REs as currently implemented. """ try: return next((L for L in open(filename) if L.find(pattern) >= 0)) except StopIteration: return ''
builtins import next from builtins import str from builtins import input from builtins import map from past.builtins import basestring from string import Template import inspect import glob import os import shutil import collections import pip import sys def grep(pattern, filename):
64
64
68
6
57
zaber-paul/base
cloudmesh_base/util.py
Python
grep
grep
17
24
17
17
fa6b6fdb8a38bd93e322e142513637581032e3e8
bigcode/the-stack
train
37b6e0981cd270e69a968a9c
train
class
class Provider(with_metaclass(abc.ABCMeta, object)): """Base class for a BLE provider.""" @abc.abstractmethod def initialize(self): """Initialize the BLE provider. Must be called once before any other calls are made to the provider. """ raise NotImplementedError @abc.a...
class Provider(with_metaclass(abc.ABCMeta, object)):
"""Base class for a BLE provider.""" @abc.abstractmethod def initialize(self): """Initialize the BLE provider. Must be called once before any other calls are made to the provider. """ raise NotImplementedError @abc.abstractmethod def run_mainloop_with(self, target)...
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 limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, an...
256
256
917
13
242
machine-max/Adafruit_Python_BluefruitLE
Adafruit_BluefruitLE/interfaces/provider.py
Python
Provider
Provider
37
143
37
37
c0972fbc5ad5b29debdebad233dcf2a433d35fca
bigcode/the-stack
train
59037124f1795696ff60776f
train
class
class Colab: def __init__(self, name, version='4.0'): self.markdown_lines = [] self.code_lines = [] self.id = 0 self.colab = { 'license': 'Licensed under the Apache License, Version 2.0', 'copyright': 'Copyright 2020 Google LLC', 'nbformat': int(version.split('.', 1)[0]), ...
class Colab:
def __init__(self, name, version='4.0'): self.markdown_lines = [] self.code_lines = [] self.id = 0 self.colab = { 'license': 'Licensed under the Apache License, Version 2.0', 'copyright': 'Copyright 2020 Google LLC', 'nbformat': int(version.split('.', 1)[0]), 'nbformat_...
########################################################################### # # Copyright 2020 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 # # https://www.apache.org/l...
154
188
629
4
149
Ressmann/starthinker
starthinker/util/colab.py
Python
Colab
Colab
24
106
24
25
61eebd1cfa831064a5774954ba3325d5b3f35a2d
bigcode/the-stack
train
66d08b8a89f4e9cb0f310f16
train
class
class AuthError(Exception): def __init__(self, message, status_code): self.message = message self.status_code = status_code
class AuthError(Exception):
def __init__(self, message, status_code): self.message = message self.status_code = status_code
class AuthError(Exception):
5
64
30
5
0
CabraKill/hihome-dataAnalysis-client
src/firestore/auth_error.py
Python
AuthError
AuthError
1
4
1
1
9c58e2f485f4e613143bf065d6754536fcbcc3cc
bigcode/the-stack
train
4c2f6eb56d70ff6873292163
train
class
class Migration(migrations.Migration): dependencies = [ ('tracking', '0011_auto_20210423_0941'), ] operations = [ migrations.AddField( model_name='device', name='fire_type', field=models.NullBooleanField(default=None, verbose_name='Fire type'), )...
class Migration(migrations.Migration):
dependencies = [ ('tracking', '0011_auto_20210423_0941'), ] operations = [ migrations.AddField( model_name='device', name='fire_type', field=models.NullBooleanField(default=None, verbose_name='Fire type'), ), ]
# Generated by Django 3.2.5 on 2021-10-17 21:21 from django.db import migrations, models class Migration(migrations.Migration):
38
64
69
7
30
patrickmaslen/resource_tracking
tracking/migrations/0012_device_fire_type.py
Python
Migration
Migration
6
18
6
7
102772ab0f3e360c300bced9103ca2086fb2a5de
bigcode/the-stack
train
049c0e7f5bcfbc283afeb3c4
train
class
class DoSTest(FalconTestFramework): def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 2 self.extra_args = [ ['-debug=1', '-nosmsg', '-noacceptnonstdtxn', '-banscore=2000000', '-reservebalance=1000000'] for i in range(self.num_nodes)] def skip_test_if_missing_modu...
class DoSTest(FalconTestFramework):
def set_test_params(self): self.setup_clean_chain = True self.num_nodes = 2 self.extra_args = [ ['-debug=1', '-nosmsg', '-noacceptnonstdtxn', '-banscore=2000000', '-reservebalance=1000000'] for i in range(self.num_nodes)] def skip_test_if_missing_module(self): self.skip_if_no_wa...
#!/usr/bin/env python3 # Copyright (c) 2017-2019 The Particl Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import time from test_framework.test_falcon import FalconTestFramework from test_framework.messages impo...
115
256
2,356
9
105
dmuralov/particl-core
test/functional/p2p_part_dos.py
Python
DoSTest
DoSTest
15
237
15
15
6056b97331461beb885427ac16603eb76d43e2e9
bigcode/the-stack
train
d476560862c727aa2533bc1d
train
function
def _click_to_tree(ctx: click.Context, node: Union[click.Command, click.MultiCommand], ancestors=[]): """ Convert a click root command to a tree of dicts and lists :return: a json like tree """ res_childs = [] res = OrderedDict() res['is_group'] = isinstance(node, click.core.MultiCommand) ...
def _click_to_tree(ctx: click.Context, node: Union[click.Command, click.MultiCommand], ancestors=[]):
""" Convert a click root command to a tree of dicts and lists :return: a json like tree """ res_childs = [] res = OrderedDict() res['is_group'] = isinstance(node, click.core.MultiCommand) if res['is_group']: # a group, recurse for every child children = [node.get_command(...
def index(): with click.Context(click_web.click_root_cmd, info_name=click_web.click_root_cmd.name, parent=None) as ctx: return render_template('show_tree.html.j2', ctx=ctx, tree=_click_to_tree(ctx, click_web.click_root_cmd)) def _click_to_tree(ctx: click.Context, node: Union[click.Command, click.MultiComman...
81
81
272
24
57
fredrik-corneliusson/click-web
click_web/resources/index.py
Python
_click_to_tree
_click_to_tree
15
40
15
15
1939b2adba3126359902aae3e6e81d62104646db
bigcode/the-stack
train
50e6a3b7477ef1df1ced2acf
train
function
def index(): with click.Context(click_web.click_root_cmd, info_name=click_web.click_root_cmd.name, parent=None) as ctx: return render_template('show_tree.html.j2', ctx=ctx, tree=_click_to_tree(ctx, click_web.click_root_cmd))
def index():
with click.Context(click_web.click_root_cmd, info_name=click_web.click_root_cmd.name, parent=None) as ctx: return render_template('show_tree.html.j2', ctx=ctx, tree=_click_to_tree(ctx, click_web.click_root_cmd))
from collections import OrderedDict from typing import Union import click from flask import render_template import click_web def index():
27
64
57
3
23
fredrik-corneliusson/click-web
click_web/resources/index.py
Python
index
index
10
12
10
10
8160f780d6ca0b84df381bc3944ae1e75b988f56
bigcode/the-stack
train
0437cb13845ea2d124ba6163
train
function
def test_name(dir): return str(dir).replace("/", "-")
def test_name(dir):
return str(dir).replace("/", "-")
return Path(f"runner-templates/build-test-{os}").read_text() # Output files def workflow_yaml_file(dir, os, test_name): return Path(dir / f"build-test-{os}-{test_name}.yml") # String function from test dir to test name def test_name(dir):
64
64
14
5
58
grayfallstown/equality-blockchain
tests/build-workflows.py
Python
test_name
test_name
51
52
51
51
eccafcb88d42197035779bbc7f9f48c791c13b8b
bigcode/the-stack
train
5104a6c04a99e81d99d84986
train
function
def workflow_yaml_template_text(os): return Path(f"runner-templates/build-test-{os}").read_text()
def workflow_yaml_template_text(os):
return Path(f"runner-templates/build-test-{os}").read_text()
".") + ".config" try: return module_dict(importlib.import_module(module_name)) except ModuleNotFoundError: return {} def read_file(filename): with open(filename) as f: return f.read() return None # Input file def workflow_yaml_template_text(os):
64
64
24
7
56
grayfallstown/equality-blockchain
tests/build-workflows.py
Python
workflow_yaml_template_text
workflow_yaml_template_text
41
42
41
41
f75056cd13a45dfa8e56f8f9fb71de0b1f78fc4e
bigcode/the-stack
train
b992af942d5989526ebb26b4
train
function
def subdirs(root_dirs: List[str]) -> List[Path]: dirs: List[Path] = [] for r in root_dirs: dirs.extend(Path(r).rglob("**/")) return [d for d in dirs if not (any(c.startswith("_") for c in d.parts) or any(c.startswith(".") for c in d.parts))]
def subdirs(root_dirs: List[str]) -> List[Path]:
dirs: List[Path] = [] for r in root_dirs: dirs.extend(Path(r).rglob("**/")) return [d for d in dirs if not (any(c.startswith("_") for c in d.parts) or any(c.startswith(".") for c in d.parts))]
#!/usr/bin/env python3 # Run from the current directory. import argparse import testconfig import logging import subprocess from pathlib import Path from typing import List def subdirs(root_dirs: List[str]) -> List[Path]:
51
64
76
14
36
grayfallstown/equality-blockchain
tests/build-workflows.py
Python
subdirs
subdirs
13
17
13
13
e85c98a58985146861ccd066f33b9b33ab12034d
bigcode/the-stack
train
5dc69c028c015e5fe7b532a6
train
function
def test_files_in_dir(dir): g = dir.glob("test_*.py") return [] if g is None else [f for f in g]
def test_files_in_dir(dir):
g = dir.glob("test_*.py") return [] if g is None else [f for f in g]
from test dir to test name def test_name(dir): return str(dir).replace("/", "-") def transform_template(template_text, replacements): t = template_text for r, v in replacements.items(): t = t.replace(r, v) return t def test_files_in_dir(dir):
64
64
33
7
56
grayfallstown/equality-blockchain
tests/build-workflows.py
Python
test_files_in_dir
test_files_in_dir
62
64
62
62
f0baca4a241bd90a7e6dfc98c69cdbbfb5890e4b
bigcode/the-stack
train
f62de3bffe8195e840131ddd
train
function
def module_dict(module): return {k: v for k, v in module.__dict__.items() if not k.startswith("_")}
def module_dict(module):
return {k: v for k, v in module.__dict__.items() if not k.startswith("_")}
[Path] = [] for r in root_dirs: dirs.extend(Path(r).rglob("**/")) return [d for d in dirs if not (any(c.startswith("_") for c in d.parts) or any(c.startswith(".") for c in d.parts))] def module_dict(module):
63
64
28
5
59
grayfallstown/equality-blockchain
tests/build-workflows.py
Python
module_dict
module_dict
20
21
20
20
c056821598606553e87f83cba643a0eb68002985
bigcode/the-stack
train
e22cc6e7ff76d09d34628ec3
train
function
def dir_config(dir): import importlib module_name = str(dir).replace("/", ".") + ".config" try: return module_dict(importlib.import_module(module_name)) except ModuleNotFoundError: return {}
def dir_config(dir):
import importlib module_name = str(dir).replace("/", ".") + ".config" try: return module_dict(importlib.import_module(module_name)) except ModuleNotFoundError: return {}
d in dirs if not (any(c.startswith("_") for c in d.parts) or any(c.startswith(".") for c in d.parts))] def module_dict(module): return {k: v for k, v in module.__dict__.items() if not k.startswith("_")} def dir_config(dir):
63
64
49
5
58
grayfallstown/equality-blockchain
tests/build-workflows.py
Python
dir_config
dir_config
24
31
24
24
0847784b3247a3b4d231eb9f33066398bde6a712
bigcode/the-stack
train
335f17d8436341903665f588
train
function
def transform_template(template_text, replacements): t = template_text for r, v in replacements.items(): t = t.replace(r, v) return t
def transform_template(template_text, replacements):
t = template_text for r, v in replacements.items(): t = t.replace(r, v) return t
Output files def workflow_yaml_file(dir, os, test_name): return Path(dir / f"build-test-{os}-{test_name}.yml") # String function from test dir to test name def test_name(dir): return str(dir).replace("/", "-") def transform_template(template_text, replacements):
64
64
36
8
56
grayfallstown/equality-blockchain
tests/build-workflows.py
Python
transform_template
transform_template
55
59
55
55
292ce7e607a3e702e347298bb7e3d55afbd80875
bigcode/the-stack
train
fec0389b6c3e476ef1935f1c
train
function
def workflow_yaml_file(dir, os, test_name): return Path(dir / f"build-test-{os}-{test_name}.yml")
def workflow_yaml_file(dir, os, test_name):
return Path(dir / f"build-test-{os}-{test_name}.yml")
read_file(filename): with open(filename) as f: return f.read() return None # Input file def workflow_yaml_template_text(os): return Path(f"runner-templates/build-test-{os}").read_text() # Output files def workflow_yaml_file(dir, os, test_name):
64
64
29
11
52
grayfallstown/equality-blockchain
tests/build-workflows.py
Python
workflow_yaml_file
workflow_yaml_file
46
47
46
46
d706e81fa1ff69c099630dfb08d27299a595ad55
bigcode/the-stack
train
8b9de02691ee1ce8de63e28d
train
function
def dir_path(string): p = Path(string) if p.is_dir(): return p else: raise NotADirectoryError(string)
def dir_path(string):
p = Path(string) if p.is_dir(): return p else: raise NotADirectoryError(string)
replacements # Overwrite with directory specific values def update_config(parent, child): if child is None: return parent conf = child for k, v in parent.items(): if k not in child: conf[k] = v return conf def dir_path(string):
64
64
32
5
58
grayfallstown/equality-blockchain
tests/build-workflows.py
Python
dir_path
dir_path
116
121
116
116
78845f8ea7576d9f0298bf8392529f558d8ece9f
bigcode/the-stack
train
c08b2af207ac975cba52d74e
train
function
def read_file(filename): with open(filename) as f: return f.read() return None
def read_file(filename):
with open(filename) as f: return f.read() return None
items() if not k.startswith("_")} def dir_config(dir): import importlib module_name = str(dir).replace("/", ".") + ".config" try: return module_dict(importlib.import_module(module_name)) except ModuleNotFoundError: return {} def read_file(filename):
63
64
22
5
58
grayfallstown/equality-blockchain
tests/build-workflows.py
Python
read_file
read_file
34
37
34
34
0ec72f801e4c726f430be6d68ecd418836a8592a
bigcode/the-stack
train
bceda5c94fa26e7fa0dcc7e7
train
function
def generate_replacements(defaults, conf, dir, test_files): assert len(test_files) > 0 replacements = dict(defaults) if not conf["checkout_blocks_and_plots"]: replacements[ "CHECKOUT_TEST_BLOCKS_AND_PLOTS" ] = "# Omitted checking out blocks and plots repo Equality-Network/test-c...
def generate_replacements(defaults, conf, dir, test_files):
assert len(test_files) > 0 replacements = dict(defaults) if not conf["checkout_blocks_and_plots"]: replacements[ "CHECKOUT_TEST_BLOCKS_AND_PLOTS" ] = "# Omitted checking out blocks and plots repo Equality-Network/test-cache" if not conf["install_timelord"]: replaceme...
"CHECKOUT_TEST_BLOCKS_AND_PLOTS": read_file("runner-templates/checkout-test-plots.include.yml").rstrip(), "TEST_DIR": "", "TEST_NAME": "", "PYTEST_PARALLEL_ARGS": "", } # ----- # Replace with update_config def generate_replacements(defaults, conf, dir, test_files):
72
72
242
14
57
grayfallstown/equality-blockchain
tests/build-workflows.py
Python
generate_replacements
generate_replacements
81
102
81
81
68e15429639476872dee8ae0cbfb529136e790f4
bigcode/the-stack
train
679b6a0866121fc314149fb5
train
function
def update_config(parent, child): if child is None: return parent conf = child for k, v in parent.items(): if k not in child: conf[k] = v return conf
def update_config(parent, child):
if child is None: return parent conf = child for k, v in parent.items(): if k not in child: conf[k] = v return conf
["TEST_DIR"] = " ".join(sorted(test_paths)) replacements["TEST_NAME"] = test_name(str(dir)) if "test_name" in conf: replacements["TEST_NAME"] = conf["test_name"] return replacements # Overwrite with directory specific values def update_config(parent, child):
64
64
49
7
56
grayfallstown/equality-blockchain
tests/build-workflows.py
Python
update_config
update_config
106
113
106
106
952176a2c8e4ba2f8b246d16df1a3701d8065489
bigcode/the-stack
train
75d464c60bca8e04b1feb614
train
function
def estimator(data_input): return data_input
def estimator(data_input):
return data_input
# the program estimates the number of COVID-19 cases in the future # using related data that has already been collected on the same def estimator(data_input):
33
64
10
5
27
Ng-ethe/my-covid-19-estimator-py
src/estimator.py
Python
estimator
estimator
5
6
5
5
46d5eec7127d451f7e08f77581177771a49b9487
bigcode/the-stack
train
d47cca09f2e9c10a187b0d04
train
function
def period_conversion(periodType, timeToElapse): periodType = periodType.lower() if periodType == "months": timeToElapse = timeToElapse * 30 elif periodType == "weeks": timeToElapse = timeToElapse * 7 else: timeToElapse = timeToElapse return timeToElapse
def period_conversion(periodType, timeToElapse):
periodType = periodType.lower() if periodType == "months": timeToElapse = timeToElapse * 30 elif periodType == "weeks": timeToElapse = timeToElapse * 7 else: timeToElapse = timeToElapse return timeToElapse
ForICUByRequestedTime': casesForICUByRequestedTime, 'casesForVentilatorsByRequestedTime': casesForVentilatorsByRequestedTime, 'dollarsInFlight': dollarsInFlight } return severeImpact def period_conversion(periodType, timeToElapse):
64
64
84
11
52
Ng-ethe/my-covid-19-estimator-py
src/estimator.py
Python
period_conversion
period_conversion
50
58
50
50
0e2eede99dda943aba55825aeb08013f111fa110
bigcode/the-stack
train
443393a74756bf5da3d21c89
train
function
def get_severeImpact(reportedCases, timeToElapse, totalHospitalBeds, avgDailyIncomePopulation, avgDailyIncomeInUSD): currentlyInfected = reportedCases * 50 infectionsByRequestedTime = currentlyInfected * (2 ** int(timeToElapse / 3)) severeCasesByRequestedTime = int(infectionsByRequestedTime * 0.15) hosp...
def get_severeImpact(reportedCases, timeToElapse, totalHospitalBeds, avgDailyIncomePopulation, avgDailyIncomeInUSD):
currentlyInfected = reportedCases * 50 infectionsByRequestedTime = currentlyInfected * (2 ** int(timeToElapse / 3)) severeCasesByRequestedTime = int(infectionsByRequestedTime * 0.15) hospitalBedsByRequestedTime = int((totalHospitalBeds * 0.35) - severeCasesByRequestedTime ) casesForICUByRequestedTim...
ByRequestedTime, 'casesForICUByRequestedTime': casesForICUByRequestedTime, 'casesForVentilatorsByRequestedTime': casesForVentilatorsByRequestedTime, 'dollarsInFlight': dollarsInFlight } return impact def get_severeImpact(reportedCases, timeToElapse, totalHospitalBeds, avgDailyIncomePopul...
88
88
295
29
58
Ng-ethe/my-covid-19-estimator-py
src/estimator.py
Python
get_severeImpact
get_severeImpact
29
47
29
29
d203be6894fb5c63c45e136f2f293dd58bd71f40
bigcode/the-stack
train
bf459e77e6334aa4dff80ba2
train
function
def get_impact(reportedCases, timeToElapse, totalHospitalBeds, avgDailyIncomePopulation, avgDailyIncomeInUSD): currentlyInfected = reportedCases * 10 infectionsByRequestedTime = (currentlyInfected * (2 ** int(timeToElapse / 3))) severeCasesByRequestedTime = int(infectionsByRequestedTime * 0.15) hospital...
def get_impact(reportedCases, timeToElapse, totalHospitalBeds, avgDailyIncomePopulation, avgDailyIncomeInUSD):
currentlyInfected = reportedCases * 10 infectionsByRequestedTime = (currentlyInfected * (2 ** int(timeToElapse / 3))) severeCasesByRequestedTime = int(infectionsByRequestedTime * 0.15) hospitalBedsByRequestedTime = int((totalHospitalBeds * 0.35) - severeCasesByRequestedTime ) casesForICUByRequestedT...
# the program estimates the number of COVID-19 cases in the future # using related data that has already been collected on the same def estimator(data_input): return data_input def get_impact(reportedCases, timeToElapse, totalHospitalBeds, avgDailyIncomePopulation, avgDailyIncomeInUSD):
66
87
293
28
37
Ng-ethe/my-covid-19-estimator-py
src/estimator.py
Python
get_impact
get_impact
9
26
9
9
b1e2fc900287219d68cc3627b5939a90cc517f83
bigcode/the-stack
train
d5696e9c647ccea4c5f0b616
train
class
class FileData(ModelNormal): """NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. Attributes: allowed_values (dict): The key is the tuple path to the attribute and the for var_name this is (var_name,). The value...
class FileData(ModelNormal):
"""NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually. Attributes: allowed_values (dict): The key is the tuple path to the attribute and the for var_name this is (var_name,). The value is a dict with a c...
""" VRChat API Documentation The version of the OpenAPI document: 1.6.7 Contact: me@ruby.js.org Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sys # noqa: F401 from vrchatapi.model_utils import ( # noqa: F401 ApiTypeError, ModelComposed, ModelNormal, ...
187
256
2,546
6
180
vrchatapi/vrchatapi-python
vrchatapi/model/file_data.py
Python
FileData
FileData
37
330
37
37
e4b4f233ccaafb793daf7a3317c942f8a7fd3bcd
bigcode/the-stack
train
ccd1f76cdc8bff82491c6aae
train
function
def lazy_import(): from vrchatapi.model.file_status import FileStatus globals()['FileStatus'] = FileStatus
def lazy_import():
from vrchatapi.model.file_status import FileStatus globals()['FileStatus'] = FileStatus
cached_property, change_keys_js_to_python, convert_js_args_to_python_args, date, datetime, file_type, none_type, validate_get_composed_info, ) from ..model_utils import OpenApiModel from vrchatapi.exceptions import ApiAttributeError def lazy_import():
64
64
26
4
59
vrchatapi/vrchatapi-python
vrchatapi/model/file_data.py
Python
lazy_import
lazy_import
32
34
32
32
356f19a44d1526ccc20591b105679e596cd61a92
bigcode/the-stack
train
eb7380388be02b58f53d324c
train
class
class Unroller(TransformationPass): """Unroll a circuit to a given basis. Unroll (expand) non-basis, non-opaque instructions recursively to a desired basis, using decomposition rules defined for each instruction. """ def __init__(self, basis): """Unroller initializer. Args: ...
class Unroller(TransformationPass):
"""Unroll a circuit to a given basis. Unroll (expand) non-basis, non-opaque instructions recursively to a desired basis, using decomposition rules defined for each instruction. """ def __init__(self, basis): """Unroller initializer. Args: basis (list[str] or None): Tar...
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2018. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
190
238
796
7
182
dlyongemallo/qiskit-terra
qiskit/transpiler/passes/basis/unroller.py
Python
Unroller
Unroller
23
114
23
23
c31e3a8e9c3fb5e2c8881476a6968b336f7f1e64
bigcode/the-stack
train
899ad7e54db273ed32d8b444
train
class
class phantomjs(ShutItModule): def is_installed(self,shutit): return shutit.file_exists('/opt/phantomjs',directory=True) def build(self,shutit): shutit.send('pushd /opt') shutit.install('curl') shutit.install('bzip2') # TODO: latest version of pj? shutit.send('curl --insecure https://phantomjs.googlecod...
class phantomjs(ShutItModule):
def is_installed(self,shutit): return shutit.file_exists('/opt/phantomjs',directory=True) def build(self,shutit): shutit.send('pushd /opt') shutit.install('curl') shutit.install('bzip2') # TODO: latest version of pj? shutit.send('curl --insecure https://phantomjs.googlecode.com/files/phantomjs-1.9.0-linu...
EVENT SHALL #THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, #OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #SOFTWARE. from shutit_module import ShutItModule class phantomjs(ShutIt...
77
77
257
9
67
Kafkamorph/shutit
library/phantomjs/phantomjs.py
Python
phantomjs
phantomjs
25
45
25
26
4f03de7554853f955bbf0d9583b4a4290145db11
bigcode/the-stack
train
06dd07b092390723694928a6
train
function
def module(): return phantomjs( 'shutit.tk.phantomjs.phantomjs', 0.319, description='see http://phantomjs.org/', depends=['shutit.tk.setup'] )
def module():
return phantomjs( 'shutit.tk.phantomjs.phantomjs', 0.319, description='see http://phantomjs.org/', depends=['shutit.tk.setup'] )
9.0-linux-x86_64 phantomjs') shutit.send('rm phantomjs-*.tar') shutit.send('popd') return True def remove(self,shutit): shutit.send('rm -rf /opt/phantomjs') return True def module():
64
64
48
3
60
Kafkamorph/shutit
library/phantomjs/phantomjs.py
Python
module
module
47
52
47
47
307ffe8fd9665c17e17b5a53f6362549c1204370
bigcode/the-stack
train
d3953bfdc520575a25c052a4
train
function
def tagcheck(value, arg): """Gets the value of the tag in request session""" return str(value.id)==str(arg)
def tagcheck(value, arg):
"""Gets the value of the tag in request session""" return str(value.id)==str(arg)
from django import template register = template.Library() def tagcheck(value, arg):
17
64
27
7
10
joshcai/resumatch
resume_app/templatetags/tagcheck.py
Python
tagcheck
tagcheck
5
8
5
5
7bd8420434ed2ea45106fdb1206896398302a2bd
bigcode/the-stack
train
04b1caa6e3e5addd8940240f
train
function
def tag(value, arg): if arg in value.tags.all(): return True return False
def tag(value, arg):
if arg in value.tags.all(): return True return False
from django import template register = template.Library() def tagcheck(value, arg): """Gets the value of the tag in request session""" return str(value.id)==str(arg) register.filter('tagcheck', tagcheck) def tag(value, arg):
52
64
20
6
46
joshcai/resumatch
resume_app/templatetags/tagcheck.py
Python
tag
tag
12
15
12
12
65aff467c5f99e438b721b013c25866a4359ab30
bigcode/the-stack
train
5556eba65ab259741850d1fb
train
class
class AwaitableGetPipelineRunResult(GetPipelineRunResult): # pylint: disable=using-constant-test def __await__(self): if False: yield self return GetPipelineRunResult( force_update_tag=self.force_update_tag, name=self.name, provisioning_state=self....
class AwaitableGetPipelineRunResult(GetPipelineRunResult): # pylint: disable=using-constant-test
def __await__(self): if False: yield self return GetPipelineRunResult( force_update_tag=self.force_update_tag, name=self.name, provisioning_state=self.provisioning_state, request=self.request, response=self.response, ...
") @property @pulumi.getter def type(self) -> str: """ The type of the resource. """ return pulumi.get(self, "type") class AwaitableGetPipelineRunResult(GetPipelineRunResult): # pylint: disable=using-constant-test
64
64
83
23
41
test-wiz-sec/pulumi-azure-nextgen
sdk/python/pulumi_azure_nextgen/containerregistry/v20191201preview/get_pipeline_run.py
Python
AwaitableGetPipelineRunResult
AwaitableGetPipelineRunResult
92
103
92
93
4fae4d0b19335cc618377a3e03badd2326843c84
bigcode/the-stack
train
ffd748dd7e97a9b33b285888
train
class
@pulumi.output_type class GetPipelineRunResult: """ An object that represents a pipeline run for a container registry. """ def __init__(__self__, force_update_tag=None, name=None, provisioning_state=None, request=None, response=None, type=None): if force_update_tag and not isinstance(force_updat...
@pulumi.output_type class GetPipelineRunResult:
""" An object that represents a pipeline run for a container registry. """ def __init__(__self__, force_update_tag=None, name=None, provisioning_state=None, request=None, response=None, type=None): if force_update_tag and not isinstance(force_update_tag, str): raise TypeError("Expect...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables from...
120
177
592
12
108
test-wiz-sec/pulumi-azure-nextgen
sdk/python/pulumi_azure_nextgen/containerregistry/v20191201preview/get_pipeline_run.py
Python
GetPipelineRunResult
GetPipelineRunResult
18
89
18
19
3555113cb1b8224aaa0aca7729d84c51aeb423bc
bigcode/the-stack
train
4959c0e111405cfab38ceebf
train
function
def get_pipeline_run(pipeline_run_name: Optional[str] = None, registry_name: Optional[str] = None, resource_group_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetPipelineRunResult: """ Use this data source to ...
def get_pipeline_run(pipeline_run_name: Optional[str] = None, registry_name: Optional[str] = None, resource_group_name: Optional[str] = None, opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetPipelineRunResult:
""" Use this data source to access information about an existing resource. :param str pipeline_run_name: The name of the pipeline run. :param str registry_name: The name of the container registry. :param str resource_group_name: The name of the resource group to which the container registry belongs...
_tag=self.force_update_tag, name=self.name, provisioning_state=self.provisioning_state, request=self.request, response=self.response, type=self.type) def get_pipeline_run(pipeline_run_name: Optional[str] = None, registry_name: Optional[str...
92
92
307
57
35
test-wiz-sec/pulumi-azure-nextgen
sdk/python/pulumi_azure_nextgen/containerregistry/v20191201preview/get_pipeline_run.py
Python
get_pipeline_run
get_pipeline_run
106
133
106
109
cc9b45dff018fd6d41dfae76f15aca7f5933aeae
bigcode/the-stack
train
941c03d27bd3461afc974f07
train
class
class TestGetPaths(unittest.TestCase): def testEntryOrder(self): paths = [(path[0], path[1]) for path in ensure_dirs.GetPaths()] # Directories for which permissions have been set seen = set() # Current directory (changes when an entry of type C{DIR} or C{QUEUE_DIR} # is encountered) current_...
class TestGetPaths(unittest.TestCase):
def testEntryOrder(self): paths = [(path[0], path[1]) for path in ensure_dirs.GetPaths()] # Directories for which permissions have been set seen = set() # Current directory (changes when an entry of type C{DIR} or C{QUEUE_DIR} # is encountered) current_dir = None for (path, pathtype) in...
, OR # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """Script for testing ganeti.tools.en...
105
105
352
8
96
modulus-sa/ganeti
test/py/ganeti.tools.ensure_dirs_unittest.py
Python
TestGetPaths
TestGetPaths
42
84
42
42
f6f5ea3220df287e81f0e0fae59dc370fbd342f2
bigcode/the-stack
train
1bcf95db398640807054aaa1
train
class
class VirtualHostTest(helper.CPWebCase): @staticmethod def setup_server(): class Root: @cherrypy.expose def index(self): return 'Hello, world' @cherrypy.expose def dom4(self): return 'Under construction' @che...
class VirtualHostTest(helper.CPWebCase): @staticmethod
def setup_server(): class Root: @cherrypy.expose def index(self): return 'Hello, world' @cherrypy.expose def dom4(self): return 'Under construction' @cherrypy.expose def method(self, value): ...
import os import cherrypy from cherrypy.test import helper curdir = os.path.join(os.getcwd(), os.path.dirname(__file__)) class VirtualHostTest(helper.CPWebCase): @staticmethod
45
256
964
14
31
webknjaz/cherrypy
cherrypy/test/test_virtualhost.py
Python
VirtualHostTest
VirtualHostTest
9
113
9
11
fb9a25767fd12f29fabe51639cfc2e1d7c4a0268
bigcode/the-stack
train
98225df4b17449dd5cdd7572
train
function
def logEntry(entry: str, timestamp=None): if timestamp is None: timestamp = datetime.datetime.now() with open("logs/" + timestamp.strftime("%Y%m%d") + ".log", "a+", encoding="utf-8") as logfile: logfile.write("[" + timestamp.strftime("%I:%M:%S.%f %p") + "] " + entry + "\n")
def logEntry(entry: str, timestamp=None):
if timestamp is None: timestamp = datetime.datetime.now() with open("logs/" + timestamp.strftime("%Y%m%d") + ".log", "a+", encoding="utf-8") as logfile: logfile.write("[" + timestamp.strftime("%I:%M:%S.%f %p") + "] " + entry + "\n")
# This file provides some framwork for commands, including a class for commands. # It also provides access to the logEntry() function. import typing, datetime # from main.py def logEntry(entry: str, timestamp=None):
48
64
80
10
37
realicraft/Nihonium
commands/framework.py
Python
logEntry
logEntry
6
9
6
6
a5348b3f551d62d647c3719aadd5a06f3957d330
bigcode/the-stack
train
4971f93faf1653c55013e58c
train
class
class CommandInput: """A class for implementing commands inputs.""" def __init__(self, name: str, _type: str, default: str="", desc: str=""): self.name = name self.type = _type self.default = default self.desc = desc self.hasdefault = (False if self.default == "" else Tru...
class CommandInput:
"""A class for implementing commands inputs.""" def __init__(self, name: str, _type: str, default: str="", desc: str=""): self.name = name self.type = _type self.default = default self.desc = desc self.hasdefault = (False if self.default == "" else True) self.hasd...
#logfile.seek(0) #line_count = 0 #for _ in logfile: line_count += 1 #writeText(97, 2, str(line_count).rjust(4) + " entries in log file", 0, 7) class CommandInput:
64
64
175
4
60
realicraft/Nihonium
commands/framework.py
Python
CommandInput
CommandInput
15
29
15
15
a24c27b8d41d0e982cf667b66e28d54627fea95f
bigcode/the-stack
train
bdeedc0f6fd4beb5a58e5cbb
train
class
class Command: """A class for implimenting commands.""" def __init__(self, name: str, command: typing.Callable[..., str], inputs: typing.List[CommandInput], *, helpShort: str="", helpLong: str=""): self.name = name self.command = command self.inputs = inputs self.help = {"s": hel...
class Command:
"""A class for implimenting commands.""" def __init__(self, name: str, command: typing.Callable[..., str], inputs: typing.List[CommandInput], *, helpShort: str="", helpLong: str=""): self.name = name self.command = command self.inputs = inputs self.help = {"s": helpShort, "l": he...
.default == "" else True) self.hasdesc = (False if self.desc == "" else True) def getShort(self) -> str: return self.name + ";" + self.type + (";" + self.default if self.hasdefault else "") def getLong(self) -> str: return "(" + self.type + ") " + self.name + (" " + self.desc i...
106
107
358
3
103
realicraft/Nihonium
commands/framework.py
Python
Command
Command
31
61
31
31
a44e554f168f28830ec7392a9490cc21fed85fcb
bigcode/the-stack
train
c4563184d843756f81134c04
train
class
class RandomBiasField(RandomTransform): r"""Add random MRI bias field artifact. Args: coefficients: Magnitude :math:`n` of polynomial coefficients. If a tuple :math:`(a, b)` is specified, then :math:`n \sim \mathcal{U}(a, b)`. order: Order of the basis polynomial functio...
class RandomBiasField(RandomTransform):
r"""Add random MRI bias field artifact. Args: coefficients: Magnitude :math:`n` of polynomial coefficients. If a tuple :math:`(a, b)` is specified, then :math:`n \sim \mathcal{U}(a, b)`. order: Order of the basis polynomial functions. p: Probability that this tra...
from typing import Union, Tuple, Optional import numpy as np import torch from ....torchio import DATA, TypeData from ....data.subject import Subject from .. import RandomTransform class RandomBiasField(RandomTransform):
47
256
998
7
39
Jimmy2027/torchio
torchio/transforms/augmentation/intensity/random_bias_field.py
Python
RandomBiasField
RandomBiasField
9
126
9
9
728fb84630ea7599b4e0697dd3992a0432bd017d
bigcode/the-stack
train
37eec5c7a8ff090a7ca73bd9
train
class
class ExpandInstanceNodeRequest: """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition. """ sensitive_...
class ExpandInstanceNodeRequest:
""" Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition. """ sensitive_list = [] openapi_types = { ...
# coding: utf-8 import pprint import re import six class ExpandInstanceNodeRequest:
22
216
722
6
15
NQLoong/huaweicloud-sdk-python-v3
huaweicloud-sdk-gaussdbfornosql/huaweicloudsdkgaussdbfornosql/v3/model/expand_instance_node_request.py
Python
ExpandInstanceNodeRequest
ExpandInstanceNodeRequest
12
134
12
14
8a0673c44f06cf09efc9194cc0b1f34a10ebf13c
bigcode/the-stack
train
46cf4a99630f9e778f17baed
train
class
class RachioZone(RachioSwitch): """Representation of one zone of sprinklers connected to the Rachio Iro.""" def __init__(self, person, controller, data, current_schedule): """Initialize a new Rachio Zone.""" self.id = data[KEY_ID] self._zone_name = data[KEY_NAME] self._zone_numb...
class RachioZone(RachioSwitch):
"""Representation of one zone of sprinklers connected to the Rachio Iro.""" def __init__(self, person, controller, data, current_schedule): """Initialize a new Rachio Zone.""" self.id = data[KEY_ID] self._zone_name = data[KEY_NAME] self._zone_number = data[KEY_ZONE_NUMBER] ...
turn_off(self, **kwargs) -> None: """Resume controller functionality.""" self._controller.rachio.device.rain_delay(self._controller.controller_id, 0) _LOGGER.debug("Canceling rain delay") async def async_added_to_hass(self): """Subscribe to updates.""" if KEY_RAIN_DELAY in ...
256
256
1,073
10
246
basicpail/core
homeassistant/components/rachio/switch.py
Python
RachioZone
RachioZone
339
466
339
339
fd5bb3dd93d52df688b7cc81bc158a403092b594
bigcode/the-stack
train
ff2857557da6771aa6bb46ef
train
class
class RachioStandbySwitch(RachioSwitch): """Representation of a standby status/button.""" @property def name(self) -> str: """Return the name of the standby switch.""" return f"{self._controller.name} in standby mode" @property def unique_id(self) -> str: """Return a unique...
class RachioStandbySwitch(RachioSwitch):
"""Representation of a standby status/button.""" @property def name(self) -> str: """Return the name of the standby switch.""" return f"{self._controller.name} in standby mode" @property def unique_id(self) -> str: """Return a unique id by combining controller id and purpos...
_any_update(self, *args, **kwargs) -> None: """Determine whether an update event applies to this device.""" if args[0][KEY_DEVICE_ID] != self._controller.controller_id: # For another device return # For this device self._async_handle_update(args, kwargs) @ab...
108
109
364
12
96
basicpail/core
homeassistant/components/rachio/switch.py
Python
RachioStandbySwitch
RachioStandbySwitch
204
251
204
204
6296aceec8156c1ed49eefc7ef6039a8d76daf35
bigcode/the-stack
train
5ab34f40bd5ba5f8e7c55599
train
class
class RachioSwitch(RachioDevice, SwitchEntity): """Represent a Rachio state that can be toggled.""" def __init__(self, controller): """Initialize a new Rachio switch.""" super().__init__(controller) self._state = None @property def name(self) -> str: """Get a name for t...
class RachioSwitch(RachioDevice, SwitchEntity):
"""Represent a Rachio state that can be toggled.""" def __init__(self, controller): """Initialize a new Rachio switch.""" super().__init__(controller) self._state = None @property def name(self) -> str: """Get a name for this switch.""" return f"Switch on {self....
.append(RachioZone(person, controller, zone, current_schedule)) for sched in schedules + flex_schedules: entities.append(RachioSchedule(person, controller, sched, current_schedule)) _LOGGER.debug("Added %s", entities) return entities class RachioSwitch(RachioDevice, SwitchEntity):
68
68
227
13
54
basicpail/core
homeassistant/components/rachio/switch.py
Python
RachioSwitch
RachioSwitch
171
201
171
171
885e2899ae5d723129c935ceedeadd4eb525dbc7
bigcode/the-stack
train
eb22ac1df3556cf1536a2e45
train
function
async def async_setup_entry(hass, config_entry, async_add_entities): """Set up the Rachio switches.""" zone_entities = [] has_flex_sched = False entities = await hass.async_add_executor_job(_create_entities, hass, config_entry) for entity in entities: if isinstance(entity, RachioZone): ...
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Set up the Rachio switches.""" zone_entities = [] has_flex_sched = False entities = await hass.async_add_executor_job(_create_entities, hass, config_entry) for entity in entities: if isinstance(entity, RachioZone): zone_entities.append(entity) if isinstance(entity, Rac...
"percent" ATTR_SCHEDULE_SUMMARY = "Summary" ATTR_SCHEDULE_ENABLED = "Enabled" ATTR_SCHEDULE_DURATION = "Duration" ATTR_SCHEDULE_TYPE = "Type" ATTR_SORT_ORDER = "sortOrder" ATTR_ZONE_NUMBER = "Zone number" ATTR_ZONE_SHADE = "Shade" ATTR_ZONE_SLOPE = "Slope" ATTR_ZONE_SUMMARY = "Summary" ATTR_ZONE_TYPE = "Type" START_M...
138
138
462
15
123
basicpail/core
homeassistant/components/rachio/switch.py
Python
async_setup_entry
async_setup_entry
91
148
91
91
afe95cd0ee18ab4ff6b38a516700b8bb8d0eb290
bigcode/the-stack
train
19cbcc8151b4c1a49a005c28
train
function
def _create_entities(hass, config_entry): entities = [] person = hass.data[DOMAIN_RACHIO][config_entry.entry_id] # Fetch the schedule once at startup # in order to avoid every zone doing it for controller in person.controllers: entities.append(RachioStandbySwitch(controller)) entitie...
def _create_entities(hass, config_entry):
entities = [] person = hass.data[DOMAIN_RACHIO][config_entry.entry_id] # Fetch the schedule once at startup # in order to avoid every zone doing it for controller in person.controllers: entities.append(RachioStandbySwitch(controller)) entities.append(RachioRainDelay(controller)) ...
_flex_sched: platform = entity_platform.async_get_current_platform() platform.async_register_entity_service( SERVICE_SET_ZONE_MOISTURE, {vol.Required(ATTR_PERCENT): cv.positive_int}, "set_moisture_percent", ) def _create_entities(hass, config_entry):
64
64
177
10
54
basicpail/core
homeassistant/components/rachio/switch.py
Python
_create_entities
_create_entities
151
168
151
151
757c0fd1146b6018610adaa7705577e2c2e9c6ed
bigcode/the-stack
train
b24229564dd5cfbaaafd03cd
train
class
class RachioRainDelay(RachioSwitch): """Representation of a rain delay status/switch.""" def __init__(self, controller): """Set up a Rachio rain delay switch.""" self._cancel_update = None super().__init__(controller) @property def name(self) -> str: """Return the name ...
class RachioRainDelay(RachioSwitch):
"""Representation of a rain delay status/switch.""" def __init__(self, controller): """Set up a Rachio rain delay switch.""" self._cancel_update = None super().__init__(controller) @property def name(self) -> str: """Return the name of the switch.""" return f"{s...
TYPE_SLEEP_MODE_ON: self._state = True elif args[0][0][KEY_SUBTYPE] == SUBTYPE_SLEEP_MODE_OFF: self._state = False self.async_write_ha_state() def turn_on(self, **kwargs) -> None: """Put the controller in standby mode.""" self._controller.rachio.device.turn_...
207
207
692
11
196
basicpail/core
homeassistant/components/rachio/switch.py
Python
RachioRainDelay
RachioRainDelay
254
336
254
254
841ad993a267c4bf7ef82247ab5310b867cdacaf
bigcode/the-stack
train
3d799666669de3370e3aae66
train
class
class RachioSchedule(RachioSwitch): """Representation of one fixed schedule on the Rachio Iro.""" def __init__(self, person, controller, data, current_schedule): """Initialize a new Rachio Schedule.""" self._schedule_id = data[KEY_ID] self._schedule_name = data[KEY_NAME] self._d...
class RachioSchedule(RachioSwitch):
"""Representation of one fixed schedule on the Rachio Iro.""" def __init__(self, person, controller, data, current_schedule): """Initialize a new Rachio Schedule.""" self._schedule_id = data[KEY_ID] self._schedule_name = data[KEY_NAME] self._duration = data[KEY_DURATION] ...
kwargs) -> None: """Handle incoming webhook zone data.""" if args[0][KEY_ZONE_ID] != self.zone_id: return self._summary = args[0][KEY_SUMMARY] if args[0][KEY_SUBTYPE] == SUBTYPE_ZONE_STARTED: self._state = True elif args[0][KEY_SUBTYPE] in [ ...
196
196
656
10
186
basicpail/core
homeassistant/components/rachio/switch.py
Python
RachioSchedule
RachioSchedule
469
550
469
469
bae1c08267850bc14916202c2aad0240bb01fe18
bigcode/the-stack
train
a9aabb5e872afcf0b75b9be4
train
class
class MockServiceClient(object): def __init__(self): # We maintain a mapping from url to MockPathContext objects. Each # unique url gets an unique context. The context provides the # MagicMock used to mock the http methods (GET, etc.) in all Path # objects initialied with that url...
class MockServiceClient(object):
def __init__(self): # We maintain a mapping from url to MockPathContext objects. Each # unique url gets an unique context. The context provides the # MagicMock used to mock the http methods (GET, etc.) in all Path # objects initialied with that url. self.__context_map = {} ...
.GET.return_value = { 'Return': 'Data' } do_something_that_uses_service_client() mock_client.GET.assert_called_once_with(query_param = 10) def test_bar(self): with cgf_service_client.mock.patch() as mock_service_client: mock_client = mock_service_client.for_url('test-base-u...
132
132
441
7
125
jeikabu/lumberyard
dev/Gems/CloudGemFramework/v1/AWS/common-code/ServiceClient_Python/cgf_service_client/mock.py
Python
MockServiceClient
MockServiceClient
60
122
60
62
4075ba2ec64b07e5a14093536d629f772cddad22
bigcode/the-stack
train
954eb2e8cb3b46d59f918aef
train
class
class MockPathContext(object): def __init__(self, url): # Each url gets a MockPathContext, and for each of those we keep track of # the config object used to make each request and provide the shared # MagicMock used for http methods on that url. self.__get_call_configs = [] ...
class MockPathContext(object):
def __init__(self, url): # Each url gets a MockPathContext, and for each of those we keep track of # the config object used to make each request and provide the shared # MagicMock used for http methods on that url. self.__get_call_configs = [] self.__get_method_mock = rea...
object. return MockPath(mock_context, url, **kwargs) # Patch the Path constructor method so that it calls the method above instead. return ( real_mock.patch('cgf_service_client.path.Path', side_effect = new_path), real_mock.patch('cgf_service_client.Path', side_effe...
107
107
357
6
100
jeikabu/lumberyard
dev/Gems/CloudGemFramework/v1/AWS/common-code/ServiceClient_Python/cgf_service_client/mock.py
Python
MockPathContext
MockPathContext
125
157
125
126
9c8dbafbf0ecf264d6e36934bb4a170060671ddc
bigcode/the-stack
train
62d4b92ed34d993ed33791a2
train
function
def patch(): '''Patch the cgf_service_client system. Can be used as either a function decorator or a context object. Examples: @cgf_service_client.mock.patch() def test_foo(self, mock_service_client): mock_client = mock_service_client.for_url('test-base-url').navigate('xyz', '...
def patch():
'''Patch the cgf_service_client system. Can be used as either a function decorator or a context object. Examples: @cgf_service_client.mock.patch() def test_foo(self, mock_service_client): mock_client = mock_service_client.for_url('test-base-url').navigate('xyz', 'bar') ...
, pathname, desc = imp.find_module('mock', sys.path[1:]) real_mock = imp.load_module('real_mock', f, pathname, desc) if f: f.close() # ServiceClient import cgf_service_client # Utils from cgf_utils.data_utils import Data def patch():
64
64
201
3
60
jeikabu/lumberyard
dev/Gems/CloudGemFramework/v1/AWS/common-code/ServiceClient_Python/cgf_service_client/mock.py
Python
patch
patch
31
58
31
31
b3c139e43f930103c052f9e4a1e6207ca7ff8c4d
bigcode/the-stack
train
6995b7da985dfc8f1f78c92e
train
class
class MockPath(cgf_service_client.Path): def __init__(self, mock_context, url, **kwargs): super(MockPath, self).__init__(url, **kwargs) mock_context.bind(self) def __repr__(self): return 'MockPath({})'.format(str(self))
class MockPath(cgf_service_client.Path):
def __init__(self, mock_context, url, **kwargs): super(MockPath, self).__init__(url, **kwargs) mock_context.bind(self) def __repr__(self): return 'MockPath({})'.format(str(self))
mock_name, k ) assert v == call_config.DATA[k], 'Expected {} configuration {} value to be {}, but there it was {}.'.format( self._mock_name, k, v, call_config.DATA[k] ) class MockPath(cgf_service_client....
63
64
63
9
54
jeikabu/lumberyard
dev/Gems/CloudGemFramework/v1/AWS/common-code/ServiceClient_Python/cgf_service_client/mock.py
Python
MockPath
MockPath
238
245
238
239
b60a977b9724a380ee83e13c0b9cb908ecc59476
bigcode/the-stack
train
d029c2f2b7bd6e799ca233ac
train
class
class HttpMethodMock(object): def __init__(self, mock_path, call_configs, shared_mock): # completely wrap the shared_mock # from https://stackoverflow.com/questions/1443129/completely-wrap-an-object-in-python self.__dict__ = shared_mock.__dict__ self.__class__ = type( ...
class HttpMethodMock(object):
def __init__(self, mock_path, call_configs, shared_mock): # completely wrap the shared_mock # from https://stackoverflow.com/questions/1443129/completely-wrap-an-object-in-python self.__dict__ = shared_mock.__dict__ self.__class__ = type( shared_mock.__class__.__name__...
That object will forward all calls to the # mock to the method mock we provide, except __call__, which it # overrides to capture the CONFIG from the MockPath object each # time the mock is invoked. setattr(mock_path, 'GET', HttpMethodMock(mock_path, self.__get_call_configs, self.__ge...
159
159
533
7
152
jeikabu/lumberyard
dev/Gems/CloudGemFramework/v1/AWS/common-code/ServiceClient_Python/cgf_service_client/mock.py
Python
HttpMethodMock
HttpMethodMock
160
234
160
162
f835cc7365ed73264bdfd5ffe8e3584604039f33
bigcode/the-stack
train
3c037e0d2c2930b48fb0bfd4
train
function
def decode_instruction(instr): if not instr[7] and instr[12:16] == "0b1111" and instr[16:20] != "0b1111": # Load Register Halfword return LdrhLiteralT1 elif not instr[7] and instr[12:16] == "0b1111" and instr[16:20] == "0b1111": # Preload Data return PldLiteralT1 elif instr[7...
def decode_instruction(instr):
if not instr[7] and instr[12:16] == "0b1111" and instr[16:20] != "0b1111": # Load Register Halfword return LdrhLiteralT1 elif not instr[7] and instr[12:16] == "0b1111" and instr[16:20] == "0b1111": # Preload Data return PldLiteralT1 elif instr[7:9] == "0b00" and instr[12:16] ...
from ldrh_literal_t1 import LdrhLiteralT1 from pld_literal_t1 import PldLiteralT1 from ldrh_immediate_thumb_t3 import LdrhImmediateThumbT3 from ldrh_immediate_thumb_t2 import LdrhImmediateThumbT2 from ldrh_register_t2 import LdrhRegisterT2 from ldrht_t1 import LdrhtT1 from pld_register_t1 import PldRegisterT1 from pld_...
215
256
925
5
209
matan1008/armulator
armulator/armv6/opcodes/thumb_instruction_set/thumb_instruction_set_encoding_32_bit/thumb_load_halfword_memory_hints/__init__.py
Python
decode_instruction
decode_instruction
17
61
17
17
c292c1b9a9dbf10976ff21ca2e5869250dd0eee3
bigcode/the-stack
train
40b63d39f0fb7e650abe449d
train
class
class Dict(Interface): def __init__(self): self.lock = Lock() self.data = dict() Interface.__init__(self) def __getstate__(self): return {'data': self.data} def __setstate__(self, state): Interface.__setstate__(self, state) Dict.__init__(self) self.d...
class Dict(Interface):
def __init__(self): self.lock = Lock() self.data = dict() Interface.__init__(self) def __getstate__(self): return {'data': self.data} def __setstate__(self, state): Interface.__setstate__(self, state) Dict.__init__(self) self.data = state['data'] ...
from .core import Interface from threading import Lock class Dict(Interface):
16
108
360
5
10
jrbourbeau/partd
partd/dict.py
Python
Dict
Dict
5
66
5
5
a7ab60967d9ae475d23812779936431c184eef2d
bigcode/the-stack
train
845862aba1c293c932ef7a8c
train
function
@k8s.command() @click.argument('NAME') @click.option('--storage', required=True) @click.option('--kubeconfig', default=Path('~/.kube/config').expanduser()) @click.option('--cloud') @click.option('--region') def add(name, storage, kubeconfig, cloud, region): args = ['add-k8s', name, '--storage', storage] if clo...
@k8s.command() @click.argument('NAME') @click.option('--storage', required=True) @click.option('--kubeconfig', default=Path('~/.kube/config').expanduser()) @click.option('--cloud') @click.option('--region') def add(name, storage, kubeconfig, cloud, region):
args = ['add-k8s', name, '--storage', storage] if cloud: args += ['--cloud', cloud] if region: args += ['--region', region] juju(*args, env={'KUBECONFIG': kubeconfig})
pass @k8s.command() @click.argument('NAME') @click.option('--storage', required=True) @click.option('--kubeconfig', default=Path('~/.kube/config').expanduser()) @click.option('--cloud') @click.option('--region') def add(name, storage, kubeconfig, cloud, region):
64
64
121
62
1
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
add
add
490
505
490
496
efd3655a32637380251ac5066f923739fdc85b3a
bigcode/the-stack
train
4d7e5834711d42f9e63bb5ee
train
function
@cli.command() @click.argument('CONTROLLER') @click.option('--model', default='kubeflow') def info(controller, model): kubeflow_info(controller, model)
@cli.command() @click.argument('CONTROLLER') @click.option('--model', default='kubeflow') def info(controller, model):
kubeflow_info(controller, model)
f'\nCongratulations, Kubeflow is now available. Took {int(end - start)} seconds.', color='green', ) kubeflow_info(controller, model) @cli.command() @click.argument('CONTROLLER') @click.option('--model', default='kubeflow') def info(controller, model):
64
64
36
27
37
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
info
info
358
362
358
361
b5b5fe2bc042b46e00b0c5bfbad0f7010b4461bc
bigcode/the-stack
train
6a886756076bcd5944073d4d
train
function
def kubeflow_info(controller: str, model: str): """Displays info about the deploy Kubeflow instance.""" pub_addr = get_pub_addr(controller) print( textwrap.dedent( f""" The central dashboard is available at http://{pub_addr}/ To display the login credentials, run thes...
def kubeflow_info(controller: str, model: str):
"""Displays info about the deploy Kubeflow instance.""" pub_addr = get_pub_addr(controller) print( textwrap.dedent( f""" The central dashboard is available at http://{pub_addr}/ To display the login credentials, run these commands: juju config dex-auth st...
stderr=subprocess.PIPE, ) break except subprocess.CalledProcessError: click.echo(wait_msg) time.sleep(5) else: click.secho(fail_msg, _fg='red') sys.exit(1) def kubeflow_info(controller: str, model: str):
64
64
182
13
51
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
kubeflow_info
kubeflow_info
85
113
85
85
faf5768262da11fbdcd4e93283abca242e05b9e5
bigcode/the-stack
train
bc89f66e31e4c5233ff2c7dc
train
function
def wait_for(*args: str, wait_msg: str, fail_msg: str): """Waits for subcommand to run successfully, with timeout.""" for _ in range(12): try: subprocess.run( args, check=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, ...
def wait_for(*args: str, wait_msg: str, fail_msg: str):
"""Waits for subcommand to run successfully, with timeout.""" for _ in range(12): try: subprocess.run( args, check=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, ) ...
get_output(*args: str): """Gets output from subcommand without echoing stdout.""" return subprocess.run( args, check=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, ).stdout def wait_for(*args: str, wait_msg: str, fail_msg: str):
64
64
116
18
45
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
wait_for
wait_for
64
82
64
64
52324f8d7d2017c1bc57afa18f05f50db7626fc5
bigcode/the-stack
train
aa783b740502710b74e66123
train
function
@cli.group() def ck(): pass
@cli.group() def ck():
pass
up', fail_msg='Waited too long for addons to come up!', ) juju('bootstrap', 'microk8s', controller, *model_defaults) @microk8s.command() def info(): microk8s_info('kubeflow') @cli.group() def ck():
64
64
10
7
57
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
ck
ck
416
418
416
417
cbcf34bf143a6b3cf53fa0043575cb5f87e9fc94
bigcode/the-stack
train
2d74d02e794e16d8fbb82877
train
function
@microk8s.command() def info(): microk8s_info('kubeflow')
@microk8s.command() def info():
microk8s_info('kubeflow')
timeout=10m", wait_msg='Waiting for DNS and storage plugins to finish setting up', fail_msg='Waited too long for addons to come up!', ) juju('bootstrap', 'microk8s', controller, *model_defaults) @microk8s.command() def info():
64
64
21
10
54
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
info
info
411
413
411
412
0498f0cf575c9102eae1df8e82686eb5c93f11b3
bigcode/the-stack
train
7ae89ff0a699ddf5742f7b99
train
function
def get_pub_addr(controller: str): """Gets the hostname that Ambassador will respond to.""" # Check if we've manually set a hostname on the ingress try: output = get_output('juju', 'kubectl', 'get', 'ingress/ambassador', '-ojson') return json.loads(output)['spec']['rules'][0]['host'] ex...
def get_pub_addr(controller: str):
"""Gets the hostname that Ambassador will respond to.""" # Check if we've manually set a hostname on the ingress try: output = get_output('juju', 'kubectl', 'get', 'ingress/ambassador', '-ojson') return json.loads(output)['spec']['rules'][0]['host'] except (KeyError, subprocess.CalledPr...
Run `juju destroy-controller --help` for a full listing of options, # such as how to release storage instead of destroying it. juju destroy-controller {controller} --destroy-storage For more information, see documentation at: https://github.com/juju-solutions/bundle-kubeflow/b...
84
84
282
8
76
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
get_pub_addr
get_pub_addr
171
197
171
171
79a8b98f80d11ddebd0abcb119afe240fd20171d
bigcode/the-stack
train
b7500c1b5d1954aa7dbf4193
train
function
@click.group() @click.option('--debug/--no-debug', default=False) def cli(debug): if debug: global juju juju = juju_debug
@click.group() @click.option('--debug/--no-debug', default=False) def cli(debug):
if debug: global juju juju = juju_debug
' def get_random_pass(): """Generates decently long random password.""" return ''.join(random.choices(string.ascii_uppercase + string.digits, k=30)) ####### # CLI # ####### @click.group() @click.option('--debug/--no-debug', default=False) def cli(debug):
63
64
36
19
44
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
cli
cli
211
216
211
213
774764a7b59678f9da456212b22ba07c93e581a7
bigcode/the-stack
train
3cdc1b4fb483803f1925f7bf
train
function
def ck_info(controller): """Displays info about Charmed Kubernetes.""" config = json.loads( get_output('juju', 'kubectl', '-m', f'{controller}:default', 'config', 'view', '-ojson') ) dashboard = config['clusters'][0]['cluster']['server'] username = config['users'][0]['user']['username'] ...
def ck_info(controller):
"""Displays info about Charmed Kubernetes.""" config = json.loads( get_output('juju', 'kubectl', '-m', f'{controller}:default', 'config', 'view', '-ojson') ) dashboard = config['clusters'][0]['cluster']['server'] username = config['users'][0]['user']['username'] password = config['user...
MicroK8s.""" print( textwrap.dedent( f""" Run `microk8s.kubectl proxy` to be able to access the dashboard at http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview?namespace={model} """ ) ) def ck_info(con...
81
81
270
5
76
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
ck_info
ck_info
130
168
130
130
f2515b98d82294676bd2f77e91bddba599d7d83f
bigcode/the-stack
train
d80170cd80a84e05dd87d83d
train
function
def juju_debug(*args, env=None, die=True): run('juju', '--debug', *args, env=env, die=die)
def juju_debug(*args, env=None, die=True):
run('juju', '--debug', *args, env=env, die=die)
_CONTROLLERS = {'microk8s': 'uk8s', 'aws': 'ckkf'} def juju(*args, env=None, die=True): run('juju', *args, env=env, die=die) def juju_debug(*args, env=None, die=True):
64
64
32
13
51
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
juju_debug
juju_debug
22
23
22
22
3dcd0bc1674585f1705f9b31a03d214f1511b8a3
bigcode/the-stack
train
10ae364f5aac6d77894b4bcc
train
function
@k8s.command() @click.argument('NAME') def remove(name): juju('remove-k8s', name)
@k8s.command() @click.argument('NAME') def remove(name):
juju('remove-k8s', name)
, '--storage', storage] if cloud: args += ['--cloud', cloud] if region: args += ['--region', region] juju(*args, env={'KUBECONFIG': kubeconfig}) @k8s.command() @click.argument('NAME') def remove(name):
64
64
26
15
49
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
remove
remove
508
511
508
510
86af2a404536772218f646ba5ebfe35826eb886c
bigcode/the-stack
train
6026a6b446f1d551143ec6b8
train
function
@ck.command() @click.option('--cloud', default='aws') @click.option('--region', default='us-east-1') @click.option('--controller') @click.option('--channel', default='stable') @click.option('--gpu/--no-gpu', default=False) def setup(cloud, region, controller, channel, gpu): if not controller: controller = D...
@ck.command() @click.option('--cloud', default='aws') @click.option('--region', default='us-east-1') @click.option('--controller') @click.option('--channel', default='stable') @click.option('--gpu/--no-gpu', default=False) def setup(cloud, region, controller, channel, gpu):
if not controller: controller = DEFAULT_CONTROLLERS[cloud] start = time.time() deploy_args = [ 'cs:bundle/canonical-kubernetes', '--trust', '--channel', channel, '--overlay', 'overlays/ck.yml', '--overlay', f'overlays/ck-{cloud}.yml',...
ju('bootstrap', 'microk8s', controller, *model_defaults) @microk8s.command() def info(): microk8s_info('kubeflow') @cli.group() def ck(): pass @ck.command() @click.option('--cloud', default='aws') @click.option('--region', default='us-east-1') @click.option('--controller') @click.option('--channel', default...
112
112
375
65
46
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
setup
setup
421
476
421
427
64405a8ce7801137252e66ccb05d01f87304714c
bigcode/the-stack
train
35969118355412f55a1e2c11
train
function
def get_output(*args: str): """Gets output from subcommand without echoing stdout.""" return subprocess.run( args, check=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, ).stdout
def get_output(*args: str):
"""Gets output from subcommand without echoing stdout.""" return subprocess.run( args, check=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, ).stdout
subprocess.CalledProcessError as err: if die: if result.stderr: click.secho(result.stderr.decode('utf-8'), color='red') click.secho(str(err), color='red') sys.exit(1) else: raise def get_output(*args: str):
64
64
47
8
55
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
get_output
get_output
56
61
56
56
bf8b94d8be1dbb42cef2828227581a2f5dfd55d4
bigcode/the-stack
train
1724020bfb12a169a53f5ce4
train
function
def microk8s_info(model): """Displays info about MicroK8s.""" print( textwrap.dedent( f""" Run `microk8s.kubectl proxy` to be able to access the dashboard at http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview?namespace...
def microk8s_info(model):
"""Displays info about MicroK8s.""" print( textwrap.dedent( f""" Run `microk8s.kubectl proxy` to be able to access the dashboard at http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/#!/overview?namespace={model} """ ...
storage instead of destroying it. juju destroy-model {controller}:{model} --destroy-storage For more information, see documentation at: https://github.com/juju-solutions/bundle-kubeflow/blob/master/README.md """ ) ) def microk8s_info(model):
64
64
89
8
56
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
microk8s_info
microk8s_info
116
127
116
116
15126b9f0ce8f5c111d2c1c4e774bc978b2b0229
bigcode/the-stack
train
372cb8f22c103b2996d65449
train
function
def run(*args, env: dict = None, check=True, die=True): """Runs command and exits script gracefully on errors.""" click.secho(f'+ {" ".join(args)}', color='green') if env is None: env = os.environ else: env = {**env, **os.environ} result = subprocess.run(args, env=env) if che...
def run(*args, env: dict = None, check=True, die=True):
"""Runs command and exits script gracefully on errors.""" click.secho(f'+ {" ".join(args)}', color='green') if env is None: env = os.environ else: env = {**env, **os.environ} result = subprocess.run(args, env=env) if check: try: result.check_returncode() ...
env, die=die) def juju_debug(*args, env=None, die=True): run('juju', '--debug', *args, env=env, die=die) ############# # UTILITIES # ############# def run(*args, env: dict = None, check=True, die=True):
63
64
152
17
46
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
run
run
31
53
31
31
90a8305c07f74a6ca4f5d6df40458807d5ed905d
bigcode/the-stack
train
d0d4eab00f2c9899eddf6ffc
train
function
@cli.group() def k8s(): pass
@cli.group() def k8s():
pass
'\nCongratulations, Charmed Kubernetes is now available. ' f'Took {int(end - start)} seconds.' ) ck_info(controller) @ck.command() @click.option('--controller', default='ckkf') def info(controller): ck_info(controller) @cli.group() def k8s():
64
64
12
9
55
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
k8s
k8s
485
487
485
486
b3db49b54795465b088ae257ff4a9b3e40298222
bigcode/the-stack
train
f1bb36aa1024111e388bd4ad
train
function
@microk8s.command() @click.option('--controller') @click.option( '-s', '--services', default=['dns', 'storage', 'dashboard', 'ingress', 'metallb:10.64.140.43-10.64.140.49'], multiple=True, ) @click.option('--model-defaults', default=[], multiple=True) def setup(controller, services, model_defaults): ...
@microk8s.command() @click.option('--controller') @click.option( '-s', '--services', default=['dns', 'storage', 'dashboard', 'ingress', 'metallb:10.64.140.43-10.64.140.49'], multiple=True, ) @click.option('--model-defaults', default=[], multiple=True) def setup(controller, services, model_defaults):
if not controller: controller = DEFAULT_CONTROLLERS['microk8s'] for service in services: click.secho(f'Running microk8s.enable {service}', fg='green') run('microk8s.enable', service) wait_for( 'microk8s.status', '--wait-ready', wait_msg='Waiti...
def microk8s(): pass @microk8s.command() @click.option('--controller') @click.option( '-s', '--services', default=['dns', 'storage', 'dashboard', 'ingress', 'metallb:10.64.140.43-10.64.140.49'], multiple=True, ) @click.option('--model-defaults', default=[], multiple=True) def setup(controller, servi...
94
94
316
85
8
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
setup
setup
370
408
370
379
8739813d515a514a9727be5662a894cf876f2549
bigcode/the-stack
train
3c594d82baf91cc9fab893b3
train
function
def get_random_pass(): """Generates decently long random password.""" return ''.join(random.choices(string.ascii_uppercase + string.digits, k=30))
def get_random_pass():
"""Generates decently long random password.""" return ''.join(random.choices(string.ascii_uppercase + string.digits, k=30))
)['status']['loadBalancer']['ingress'][0]['ip'] return '%s.xip.io' % pub_ip except (KeyError, subprocess.CalledProcessError) as err: pass # If all else fails, just use localhost return 'localhost' def get_random_pass():
64
64
36
5
59
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
get_random_pass
get_random_pass
200
203
200
200
080beecea853f2159065e37478aedfd3a82cb1fc
bigcode/the-stack
train
c2b18eefa0f9439116fd4bef
train
function
@ck.command() @click.option('--controller', default='ckkf') def info(controller): ck_info(controller)
@ck.command() @click.option('--controller', default='ckkf') def info(controller):
ck_info(controller)
config.name}, ) end = time.time() print( '\nCongratulations, Charmed Kubernetes is now available. ' f'Took {int(end - start)} seconds.' ) ck_info(controller) @ck.command() @click.option('--controller', default='ckkf') def info(controller):
64
64
23
18
46
RFMVasconcelos/bundle-kubeflow
scripts/cli.py
Python
info
info
479
482
479
481
d59cf5a96103c3dfc134d0cc83eee0fea6f32692
bigcode/the-stack
train