max_stars_repo_path
stringlengths
4
286
max_stars_repo_name
stringlengths
5
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.03M
content_cleaned
stringlengths
6
1.03M
language
stringclasses
111 values
language_score
float64
0.03
1
comments
stringlengths
0
556k
edu_score
float64
0.32
5.03
edu_int_score
int64
0
5
src/lgtm_test/bad.py
altendky/lgtm_test
0
6629151
import uuid def create_a_not_really_a_secret(): return uuid.uuid4() # lgtm [py/not-sensitive-data] def main(): print(create_a_not_really_a_secret()) main()
import uuid def create_a_not_really_a_secret(): return uuid.uuid4() # lgtm [py/not-sensitive-data] def main(): print(create_a_not_really_a_secret()) main()
en
0.358223
# lgtm [py/not-sensitive-data]
1.980149
2
aoa/__init__.py
nodonoughue/emitter-detection-python
0
6629152
<reponame>nodonoughue/emitter-detection-python<filename>aoa/__init__.py from .aoa import * from . import directional from . import doppler from . import interferometer from . import watson_watt
from .aoa import * from . import directional from . import doppler from . import interferometer from . import watson_watt
none
1
1.156068
1
raw_python/lib/Udp.py
KevinWorkSpace/raw_python-master
12
6629153
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # # Copyright 2018 Dept. CSE SUSTech # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # # Copyright 2018 Dept. CSE SUSTech # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
en
0.706412
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # # Copyright 2018 Dept. CSE SUSTech # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
1.443596
1
angr/analyses/vsa_ddg.py
mariusmue/angr
2
6629154
import logging from collections import defaultdict import networkx from . import Analysis from .code_location import CodeLocation from ..errors import AngrDDGError from ..sim_variable import SimRegisterVariable, SimMemoryVariable l = logging.getLogger("angr.analyses.vsa_ddg") class DefUseChain(object): """ ...
import logging from collections import defaultdict import networkx from . import Analysis from .code_location import CodeLocation from ..errors import AngrDDGError from ..sim_variable import SimRegisterVariable, SimMemoryVariable l = logging.getLogger("angr.analyses.vsa_ddg") class DefUseChain(object): """ ...
en
0.851916
Stand for a def-use chain. it is generated by the DDG itself. Constructor. :param def_loc: :param use_loc: :param variable: :return: A Data dependency graph based on VSA states. That means we don't (and shouldn't) expect any symbolic expressions. Constructor. :param vfg: ...
2.660426
3
web/app/lib/ee/filter.py
geary/claslite
0
6629155
"""Collection filters. Example usage: Filter('time', low, high) .bounds(ring) .eq('time', value) .lt('time', value) """ # Using lowercase function naming to match the JavaScript names. # pylint: disable=g-bad-name # Our custom instance/static decorator is not recognized by lint. # pylint: disable=...
"""Collection filters. Example usage: Filter('time', low, high) .bounds(ring) .eq('time', value) .lt('time', value) """ # Using lowercase function naming to match the JavaScript names. # pylint: disable=g-bad-name # Our custom instance/static decorator is not recognized by lint. # pylint: disable=...
en
0.812056
Collection filters. Example usage: Filter('time', low, high) .bounds(ring) .eq('time', value) .lt('time', value) # Using lowercase function naming to match the JavaScript names. # pylint: disable=g-bad-name # Our custom instance/static decorator is not recognized by lint. # pylint: disable=no-self-arg...
3.077636
3
GTSRB_dataloader.py
hhhhh74/DUQ
0
6629156
""" @author:yebin @file:GTSRB_dataloader.py @IDE:Pycharm @time:2020/12/18 下午1:46 @function:加载经过resize到256*256的GTSRB数据 @example: @tip: """ from torch.utils.data import DataLoader, Dataset from skimage import io from torchvision import transforms import os import torch class yebin_data_Train(Dataset): def __init__...
""" @author:yebin @file:GTSRB_dataloader.py @IDE:Pycharm @time:2020/12/18 下午1:46 @function:加载经过resize到256*256的GTSRB数据 @example: @tip: """ from torch.utils.data import DataLoader, Dataset from skimage import io from torchvision import transforms import os import torch class yebin_data_Train(Dataset): def __init__...
en
0.331926
@author:yebin @file:GTSRB_dataloader.py @IDE:Pycharm @time:2020/12/18 下午1:46 @function:加载经过resize到256*256的GTSRB数据 @example: @tip: # transforms.RandomRotation(15), #kwargs = {"num_workers": 4, "pin_memory": True} #kwargs = {"num_workers": 4, "pin_memory": True}
2.436585
2
django_visual/ide/views.py
Michaluch/django-visual
27
6629157
# -*- coding: utf-8 -*- import os from os.path import join, isdir import random import sys import subprocess from sys import stdout, stdin, stderr from django.shortcuts import render, redirect from django.http import HttpResponse from django.core.management.base import CommandError from django.conf import settings, S...
# -*- coding: utf-8 -*- import os from os.path import join, isdir import random import sys import subprocess from sys import stdout, stdin, stderr from django.shortcuts import render, redirect from django.http import HttpResponse from django.core.management.base import CommandError from django.conf import settings, S...
en
0.710901
# -*- coding: utf-8 -*- IDE welcome Open or Create Project # Projects dir may not exist, let create it Create new Django project Load project structure into IDE. Creates new application for given project Add existing application to INSTALLED_APPS Remove existing application from INSTALLED_APPS Creates new model in app...
2.231724
2
examples/test_plug.py
moradel82/openhtf
0
6629158
<reponame>moradel82/openhtf import openhtf as htf # Import this output mechanism as it's the specific one we want to use. from openhtf.output.callbacks import json_factory from openhtf.plugs import user_input # from openhtf.plugs.testPlug import TestPlug # After install so venv knows about the path from plug_chamber i...
import openhtf as htf # Import this output mechanism as it's the specific one we want to use. from openhtf.output.callbacks import json_factory from openhtf.plugs import user_input # from openhtf.plugs.testPlug import TestPlug # After install so venv knows about the path from plug_chamber import ChamberTe1007c # Doesn...
en
0.868015
# Import this output mechanism as it's the specific one we want to use. # from openhtf.plugs.testPlug import TestPlug # After install so venv knows about the path # Doesnt need an install # This is an import from plugs. In my case for this to work # the path has to be define or install openhtf after the changes # so t...
2.408834
2
provisional-st/static_data/tools/reformat_rsr.py
ldj01/espa-surface-temperature
1
6629159
# A simple tool to reformat the LUT's generated by the IDL code import os import sys from argparse import ArgumentParser if __name__ == '__main__': """Reformat the file to what is expected""" description = 'Reformat LUT files' parser = ArgumentParser(description=description) parser.add_argument('-...
# A simple tool to reformat the LUT's generated by the IDL code import os import sys from argparse import ArgumentParser if __name__ == '__main__': """Reformat the file to what is expected""" description = 'Reformat LUT files' parser = ArgumentParser(description=description) parser.add_argument('-...
en
0.910584
# A simple tool to reformat the LUT's generated by the IDL code Reformat the file to what is expected
2.84522
3
third_party/bazel/tensorrt/repo.bzl
JamesTheZ/BladeDISC
1
6629160
load("//bazel:common.bzl", "files_exist") _TENSORRT_INSTALL_PATH = "TENSORRT_INSTALL_PATH" def _cc_import_myelin(): return """ cc_import( name = "myelin_compiler_static", static_library = "lib/libmyelin_compiler_static.a", ) cc_import( name = "myelin_executor_static", static_library = "lib/libmye...
load("//bazel:common.bzl", "files_exist") _TENSORRT_INSTALL_PATH = "TENSORRT_INSTALL_PATH" def _cc_import_myelin(): return """ cc_import( name = "myelin_compiler_static", static_library = "lib/libmyelin_compiler_static.a", ) cc_import( name = "myelin_executor_static", static_library = "lib/libmye...
en
0.667017
cc_import( name = "myelin_compiler_static", static_library = "lib/libmyelin_compiler_static.a", ) cc_import( name = "myelin_executor_static", static_library = "lib/libmyelin_executor_static.a", ) cc_import( name = "myelin_pattern_library_static", static_library = "lib/libmyelin_pattern_library...
1.994777
2
challenges/prep-kit/sorting/mark_toys.py
Mrsteveson/Review
0
6629161
<reponame>Mrsteveson/Review def maximumToys(prices, k): count = 0 total = 0 prices.sort() for i in prices: total += i if total <= k: count+=1 return count
def maximumToys(prices, k): count = 0 total = 0 prices.sort() for i in prices: total += i if total <= k: count+=1 return count
none
1
3.2837
3
gym_dockauv/objects/shape.py
Erikx3/gym_dockauv
0
6629162
import numpy as np from abc import ABC, abstractmethod from functools import cached_property from typing import List class Shape(ABC): """ This is a base class for any shape, should always contain center coordinates of position. """ def __init__(self, position: np.ndarray): self.position = n...
import numpy as np from abc import ABC, abstractmethod from functools import cached_property from typing import List class Shape(ABC): """ This is a base class for any shape, should always contain center coordinates of position. """ def __init__(self, position: np.ndarray): self.position = n...
en
0.774628
This is a base class for any shape, should always contain center coordinates of position. Function that returns the plot variables for the matplotlib axes.surface_plot() function :return: return list of list of arrays for plotting (one inner list contains plotting arrays) Represents a sphere # Call inherited i...
3.639998
4
src/screen.py
pjimenezmateo/chip8
0
6629163
import pyglet class Screen(pyglet.window.Window): display_buffer = None screen_width = 64 screen_height = 32 tile_size = 10 clock = None def __init__(self, width, height): super(Screen, self).__init__(width=width, height=height, visible=True, vsync=False) ...
import pyglet class Screen(pyglet.window.Window): display_buffer = None screen_width = 64 screen_height = 32 tile_size = 10 clock = None def __init__(self, width, height): super(Screen, self).__init__(width=width, height=height, visible=True, vsync=False) ...
none
1
2.835627
3
python/jsbeautifier/core/inputscanner.py
bmewburn/js-beautify
56
6629164
# The MIT License (MIT) # # Copyright (c) 2007-2018 <NAME>, <NAME>, and contributors. # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the...
# The MIT License (MIT) # # Copyright (c) 2007-2018 <NAME>, <NAME>, and contributors. # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the...
en
0.765782
# The MIT License (MIT) # # Copyright (c) 2007-2018 <NAME>, <NAME>, and contributors. # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the...
2.213665
2
aiobungie/error.py
coxir/aiobungie
0
6629165
<gh_stars>0 # MIT License # # Copyright (c) 2020 - Present nxtlo # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy,...
# MIT License # # Copyright (c) 2020 - Present nxtlo # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, mer...
en
0.753836
# MIT License # # Copyright (c) 2020 - Present nxtlo # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, mer...
1.889235
2
src/pykeen/triples/instances.py
Rodrigo-A-Pereira/pykeen
0
6629166
<reponame>Rodrigo-A-Pereira/pykeen # -*- coding: utf-8 -*- """Implementation of basic instance factory which creates just instances based on standard KG triples.""" from abc import ABC from dataclasses import dataclass from typing import Generic, Mapping, Optional, Tuple, TypeVar import numpy as np import scipy.spar...
# -*- coding: utf-8 -*- """Implementation of basic instance factory which creates just instances based on standard KG triples.""" from abc import ABC from dataclasses import dataclass from typing import Generic, Mapping, Optional, Tuple, TypeVar import numpy as np import scipy.sparse import torch from torch.utils im...
en
0.893596
# -*- coding: utf-8 -*- Implementation of basic instance factory which creates just instances based on standard KG triples. Triples and mappings to their indices. # noqa:D401 The number of instances. # noqa: D105 Create instances from mapped triples. :param mapped_triples: shape: (num_triples, 3) T...
2.540572
3
hoodApp/urls.py
umunadine/Hood
0
6629167
<reponame>umunadine/Hood<gh_stars>0 from django.conf.urls import url from django.conf import settings from . import views from django.conf.urls.static import static urlpatterns = [ url(r'^$',views.home,name='home'), url(r'^accounts/profile/', views.my_profile, name='my_profile'), url(r'^index',views.index,...
from django.conf.urls import url from django.conf import settings from . import views from django.conf.urls.static import static urlpatterns = [ url(r'^$',views.home,name='home'), url(r'^accounts/profile/', views.my_profile, name='my_profile'), url(r'^index',views.index,name='index'), url(r'^join/(\d+)...
none
1
1.868757
2
controllers/dvi.py
himansu1997/eden
4
6629168
# -*- coding: utf-8 -*- """ Disaster Victim Identification, Controllers """ if not settings.has_module(c): raise HTTP(404, body="Module disabled: %s" % c) # ----------------------------------------------------------------------------- def s3_menu_postp(): # @todo: rewrite this for new framework menu_sele...
# -*- coding: utf-8 -*- """ Disaster Victim Identification, Controllers """ if not settings.has_module(c): raise HTTP(404, body="Module disabled: %s" % c) # ----------------------------------------------------------------------------- def s3_menu_postp(): # @todo: rewrite this for new framework menu_sele...
en
0.381836
# -*- coding: utf-8 -*- Disaster Victim Identification, Controllers # ----------------------------------------------------------------------------- # @todo: rewrite this for new framework # ----------------------------------------------------------------------------- Module's Home Page # -------------------------------...
2.10786
2
Solutions/pyodbcplaystocksTask7.py
DuongDo-Intersystems/node-odbc
0
6629169
<filename>Solutions/pyodbcplaystocksTask7.py """ PURPOSE: Simulate adding stocks to your stock portfolio and see how you would have done. NOTES: When running the application, 1. Choose option 1 to view top 10 stocks. 2. Choose option 3 to add 2 or 3 stocks to your portfolio (using names from top 10 and 2016-08-12). 3....
<filename>Solutions/pyodbcplaystocksTask7.py """ PURPOSE: Simulate adding stocks to your stock portfolio and see how you would have done. NOTES: When running the application, 1. Choose option 1 to view top 10 stocks. 2. Choose option 3 to add 2 or 3 stocks to your portfolio (using names from top 10 and 2016-08-12). 3....
en
0.768998
PURPOSE: Simulate adding stocks to your stock portfolio and see how you would have done. NOTES: When running the application, 1. Choose option 1 to view top 10 stocks. 2. Choose option 3 to add 2 or 3 stocks to your portfolio (using names from top 10 and 2016-08-12). 3. Choose option 6 using date 2017-08-10 to view yo...
3.623361
4
main.py
cottongin/twr-discord-bot
1
6629170
<reponame>cottongin/twr-discord-bot<gh_stars>1-10 import discord from discord.ext import commands import os, sys, traceback from dotenv import load_dotenv load_dotenv() """Based on https://gist.github.com/EvieePy/d78c061a4798ae81be9825468fe146be""" def get_prefix(bot, message): prefixes = ['!', '.'] return ...
import discord from discord.ext import commands import os, sys, traceback from dotenv import load_dotenv load_dotenv() """Based on https://gist.github.com/EvieePy/d78c061a4798ae81be9825468fe146be""" def get_prefix(bot, message): prefixes = ['!', '.'] return commands.when_mentioned_or(*prefixes)(bot, message...
en
0.63211
Based on https://gist.github.com/EvieePy/d78c061a4798ae81be9825468fe146be #print(token)
2.348495
2
ternary_operator.py
NathanKr/python-playground
0
6629171
flag = False msg = 'flag is True' if flag else 'flag is False' print(msg)
flag = False msg = 'flag is True' if flag else 'flag is False' print(msg)
none
1
2.504992
3
src/model/verify_vsrl.py
tengyu-liu/Part-GPNN
0
6629172
import datetime import os import pickle import random import sys import time import numpy as np from config import flags from dataloader_parallel import DataLoader import metadata import metrics import vsrl_eval vcoco_root = '/home/tengyu/Data/mscoco/v-coco' def get_vcocoeval(imageset): return vsrl_eval.VCOCOev...
import datetime import os import pickle import random import sys import time import numpy as np from config import flags from dataloader_parallel import DataLoader import metadata import metrics import vsrl_eval vcoco_root = '/home/tengyu/Data/mscoco/v-coco' def get_vcocoeval(imageset): return vsrl_eval.VCOCOev...
en
0.169527
# val_vcocoeval = get_vcocoeval('val') # test_vcocoeval = get_vcocoeval('test') # val_loader = DataLoader('val', flags.node_num, negative_suppression=flags.negative_suppression, n_jobs=flags.n_jobs, part_weight=flags.part_weight) # test_loader = DataLoader('test', flags.node_num, negative_suppression=flags.negative_sup...
1.85557
2
__init__.py
muhareb/rasa-chat
0
6629173
# Mycroft skill that acts as an interface between a Rasa chatbot and a user, # allowing continuous voice dialog between the two # Much thanks to Jamesmf for the code base and <NAME> for the technical advice from adapt.intent import IntentBuilder from mycroft.skills.core import MycroftSkill, intent_handler, intent_fil...
# Mycroft skill that acts as an interface between a Rasa chatbot and a user, # allowing continuous voice dialog between the two # Much thanks to Jamesmf for the code base and <NAME> for the technical advice from adapt.intent import IntentBuilder from mycroft.skills.core import MycroftSkill, intent_handler, intent_fil...
en
0.865468
# Mycroft skill that acts as an interface between a Rasa chatbot and a user, # allowing continuous voice dialog between the two # Much thanks to Jamesmf for the code base and <NAME> for the technical advice # Set the address of your Rasa's REST endpoint #self.RASA_API = "http://localhost:5005/webhooks/rest/webhook" # S...
2.793968
3
ToPCLI/Todoist.py
NAndLib/todoist-plugable-cli
6
6629174
<reponame>NAndLib/todoist-plugable-cli<filename>ToPCLI/Todoist.py from config import token, cache_dir from contextlib import contextmanager import sys import todoist CODE_TO_COLORS = { 30 : 'BERRY_RED', 31 : 'RED', 32 : 'ORANGE', 33 : 'YELLOW', 34 : 'OLIVE_GREEN', 35 : 'LIME_GREEN', 36 : 'G...
from config import token, cache_dir from contextlib import contextmanager import sys import todoist CODE_TO_COLORS = { 30 : 'BERRY_RED', 31 : 'RED', 32 : 'ORANGE', 33 : 'YELLOW', 34 : 'OLIVE_GREEN', 35 : 'LIME_GREEN', 36 : 'GREEN', 37 : 'MINT_GREEN', 38 : 'TEAL', 39 : 'SKY_BLUE'...
en
0.760281
Only sync if batch_mode is False. Only commit if batch_mode is False. Gets the correct command for the specified type. Sync and commit changes before toggling batch_mode Returns a dictionary of the current state, keyed by ID. - item: return the state of this specific item. - ids: only return objects mat...
2.45321
2
tests/core_tests/model_tests/position_dynamics_model_test.py
Cislunar-Explorers/CislunarSim
2
6629175
<reponame>Cislunar-Explorers/CislunarSim<filename>tests/core_tests/model_tests/position_dynamics_model_test.py import unittest from core.models.model_list import PositionDynamics from core.state import StateTime from utils.test_utils import state_1, d3456 class PositionDynamicsModelTest(unittest.TestCase): """ ...
import unittest from core.models.model_list import PositionDynamics from core.state import StateTime from utils.test_utils import state_1, d3456 class PositionDynamicsModelTest(unittest.TestCase): """ This class tests the position dynamics model implementation. """ def test_position_dynamics_model(se...
en
0.78453
This class tests the position dynamics model implementation. This function tests the position dynamics model's d_state function. # trivial tests that check to make sure the velocity components from the input to the output match exactly
3.12044
3
nmap_scannner.py
sandlib/pythonpentest
174
6629176
<filename>nmap_scannner.py<gh_stars>100-1000 #!/usr/bin/env python ''' Author: <NAME> Date: February 2015 Name: nmap_scanner.py Purpose: To scan a network Copyright (c) 2015, <NAME> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the f...
<filename>nmap_scannner.py<gh_stars>100-1000 #!/usr/bin/env python ''' Author: <NAME> Date: February 2015 Name: nmap_scanner.py Purpose: To scan a network Copyright (c) 2015, <NAME> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the f...
en
0.731109
#!/usr/bin/env python Author: <NAME> Date: February 2015 Name: nmap_scanner.py Purpose: To scan a network Copyright (c) 2015, <NAME> All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions o...
2.421221
2
app/__init__.py
ronyldo12/PowerDNS-Admin
1
6629177
<gh_stars>1-10 from werkzeug.contrib.fixers import ProxyFix from flask import Flask, request, session, redirect, url_for from flask_login import LoginManager from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config.from_object('config') app.wsgi_app = ProxyFix(app.wsgi_app) login_manager = LoginManage...
from werkzeug.contrib.fixers import ProxyFix from flask import Flask, request, session, redirect, url_for from flask_login import LoginManager from flask_sqlalchemy import SQLAlchemy app = Flask(__name__) app.config.from_object('config') app.wsgi_app = ProxyFix(app.wsgi_app) login_manager = LoginManager() login_manag...
none
1
2.314334
2
datasets/dukemtmcreid.py
AlexMuresan/centroids-reid
53
6629178
<gh_stars>10-100 # encoding: utf-8 """ Partially based on work by: @author: liaoxingyu @contact: <EMAIL> Adapted and extended by: @author: mikwieczorek """ import glob import os.path as osp import re from collections import defaultdict import pytorch_lightning as pl from torch.utils.data import (DataLoader, Dataset...
# encoding: utf-8 """ Partially based on work by: @author: liaoxingyu @contact: <EMAIL> Adapted and extended by: @author: mikwieczorek """ import glob import os.path as osp import re from collections import defaultdict import pytorch_lightning as pl from torch.utils.data import (DataLoader, Dataset, DistributedSamp...
en
0.715735
# encoding: utf-8 Partially based on work by: @author: liaoxingyu @contact: <EMAIL> Adapted and extended by: @author: mikwieczorek DukeMTMC-reID Reference: 1. Ristani et al. Performance Measures and a Data Set for Multi-Target, Multi-Camera Tracking. ECCVW 2016. 2. Zheng et al. Unlabeled Samples Generated...
1.786966
2
nonlinear_equation/newton/newton.py
sunsetyuhi/numcalc_py
0
6629179
#Newton法による非線型方程式の解法プログラム import numpy as np #NumPyライブラリ import matplotlib.pyplot as plt #データ可視化ライブラリ #解きたい方程式 def func_f(x): return x**2.0 -2.0 #Newton法(方程式の関数項、探索の開始点、微小量、誤差範囲、最大反復回数) def newton(func_f, x0, eps=1e-10, error=1e-10, max_loop=100): num_calc = 0 #計算回数 print("{:3d}: x = {:.15f}".format...
#Newton法による非線型方程式の解法プログラム import numpy as np #NumPyライブラリ import matplotlib.pyplot as plt #データ可視化ライブラリ #解きたい方程式 def func_f(x): return x**2.0 -2.0 #Newton法(方程式の関数項、探索の開始点、微小量、誤差範囲、最大反復回数) def newton(func_f, x0, eps=1e-10, error=1e-10, max_loop=100): num_calc = 0 #計算回数 print("{:3d}: x = {:.15f}".format...
ja
0.995332
#Newton法による非線型方程式の解法プログラム #NumPyライブラリ #データ可視化ライブラリ #解きたい方程式 #Newton法(方程式の関数項、探索の開始点、微小量、誤差範囲、最大反復回数) #計算回数 #ずっと繰り返す #中心差分による微分値 #傾きが0に近ければ止める #次の解を計算 #計算回数を数える #「誤差範囲が一定値以下」または「計算回数が一定値以上」ならば終了 #解を更新 #最終的に得られた解 #可視化(方程式の関数項、グラフ左端、グラフ右端、方程式の解) #x軸の名前 #y軸の名前 #点線の目盛りを表示 #f(x)=0の線 #関数 #関数を折線グラフで表示 #数値解を点グラフで表示 #グラフを表示 #メイン...
4.066316
4
smartcross/envs/action/__init__.py
opendilab/DI-smartcross
49
6629180
<gh_stars>10-100 from .sumo_action import SumoAction from .sumo_action_runner import SumoActionRunner
from .sumo_action import SumoAction from .sumo_action_runner import SumoActionRunner
none
1
1.054706
1
resources/lib/globals.py
otava5/plugin.video.netflix
0
6629181
<reponame>otava5/plugin.video.netflix # -*- coding: utf-8 -*- """ Copyright (C) 2017 <NAME> (plugin.video.netflix) Copyright (C) 2018 Caphm (original implementation module) Global addon constants SPDX-License-Identifier: MIT See LICENSES/MIT.md for more information. """ # Everything that is to be g...
# -*- coding: utf-8 -*- """ Copyright (C) 2017 <NAME> (plugin.video.netflix) Copyright (C) 2018 Caphm (original implementation module) Global addon constants SPDX-License-Identifier: MIT See LICENSES/MIT.md for more information. """ # Everything that is to be globally accessible must be defined in ...
en
0.72445
# -*- coding: utf-8 -*- Copyright (C) 2017 <NAME> (plugin.video.netflix) Copyright (C) 2018 Caphm (original implementation module) Global addon constants SPDX-License-Identifier: MIT See LICENSES/MIT.md for more information. # Everything that is to be globally accessible must be defined in this module ...
2.180318
2
plotly/figure_factory/_bullet.py
gnestor/plotly.py
2
6629182
<gh_stars>1-10 from __future__ import absolute_import import collections import math from plotly import colors, exceptions, optional_imports from plotly.figure_factory import utils import plotly import plotly.graph_objs as go pd = optional_imports.get_module('pandas') def is_sequence(obj): return (isinstance(...
from __future__ import absolute_import import collections import math from plotly import colors, exceptions, optional_imports from plotly.figure_factory import utils import plotly import plotly.graph_objs as go pd = optional_imports.get_module('pandas') def is_sequence(obj): return (isinstance(obj, collection...
en
0.644037
# layout # update layout # narrow domain if 1 bar # ranges bars # measures bars # markers # titles and subtitles Returns figure for bullet chart. :param (pd.DataFrame | list | tuple) data: either a list/tuple of dictionaries or a pandas DataFrame. :param (str) markers: the column name or dictionary key...
2.476636
2
postGIS_tools/tests/test_db_creation.py
AltaPlanning/postGIS-tools
4
6629183
import postGIS_tools as pGIS from postGIS_tools.configurations import get_postGIS_config, make_uri from ward import test def _test_make_new_database(hostname): DATABASE = "test_db" user_config, super_user_config = get_postGIS_config(verbose=False) uri = make_uri(DATABASE, **user_config[hostname]) ...
import postGIS_tools as pGIS from postGIS_tools.configurations import get_postGIS_config, make_uri from ward import test def _test_make_new_database(hostname): DATABASE = "test_db" user_config, super_user_config = get_postGIS_config(verbose=False) uri = make_uri(DATABASE, **user_config[hostname]) ...
en
0.510211
# Make a new database # Confirm it exists
2.243029
2
products/migrations/0011_auto_20200520_1323.py
stanwood/traidoo-api
3
6629184
<gh_stars>1-10 # Generated by Django 2.2.10 on 2020-05-20 13:23 from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ("products", "0010_auto_20200206_1358"), ] ...
# Generated by Django 2.2.10 on 2020-05-20 13:23 from django.conf import settings import django.core.validators from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ("products", "0010_auto_20200206_1358"), ] operations...
en
0.755214
# Generated by Django 2.2.10 on 2020-05-20 13:23
1.600097
2
src/generator.py
bmoxon/azfinsim
5
6629185
<filename>src/generator.py #! /usr/bin/env python3 # # generator.py: Load the AzFinsim Cache with randomly generated trade data of specified length # import argparse import time import sys import psutil import logging from multiprocessing.pool import ThreadPool from azure.identity import DefaultAzureCredential from co...
<filename>src/generator.py #! /usr/bin/env python3 # # generator.py: Load the AzFinsim Cache with randomly generated trade data of specified length # import argparse import time import sys import psutil import logging from multiprocessing.pool import ThreadPool from azure.identity import DefaultAzureCredential from co...
en
0.310978
#! /usr/bin/env python3 # # generator.py: Load the AzFinsim Cache with randomly generated trade data of specified length # #-- todo: fix nbytes for var, and fold these variables into create_trades #-- legacy serial method #-- TBD need to pass this #-- pipeline / batching method #-- grab cli args #-- verbosity #-- pull ...
2.274997
2
adles/interfaces/docker_interface.py
devAmoghS/ADLES
0
6629186
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softwa...
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softwa...
en
0.829729
# -*- coding: utf-8 -*- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softwar...
2.014465
2
MachineLearning/iris-k-nn-classifier.py
bahattin-urganci/python-training
0
6629187
import random from scipy.spatial import distance def euc(a, b): return distance.euclidean(a, b) class ScrappyKNN(): def fit(self, X_train, y_train): self.X_train = X_train self.y_train = y_train def predict(self, X_test): predictions = [] for row in X_test: ...
import random from scipy.spatial import distance def euc(a, b): return distance.euclidean(a, b) class ScrappyKNN(): def fit(self, X_train, y_train): self.X_train = X_train self.y_train = y_train def predict(self, X_test): predictions = [] for row in X_test: ...
en
0.364447
#label = self.closest(row) #from sklearn.neighbors import KNeighborsClassifier
3.07953
3
beastx/modules/Adultzone.py
Yaamiin/Beast-X
1
6629188
<reponame>Yaamiin/Beast-X # credits to Pawan # ported to Pawanbir by @I_AM_PAWANBIR # will be adding more soon import asyncio import os import urllib import requests from userbot import * from userbot.utils import * @bot.on(admin_cmd("boobs$")) async def boobs(event): if not os.path.isdir(Var.TEMP_DOWNLOAD_DIR...
# credits to Pawan # ported to Pawanbir by @I_AM_PAWANBIR # will be adding more soon import asyncio import os import urllib import requests from userbot import * from userbot.utils import * @bot.on(admin_cmd("boobs$")) async def boobs(event): if not os.path.isdir(Var.TEMP_DOWNLOAD_DIRECTORY): os.makedi...
en
0.882245
# credits to Pawan # ported to Pawanbir by @I_AM_PAWANBIR # will be adding more soon
2.443853
2
bikeshed/config/status.py
tpluscode/bikeshed
0
6629189
<filename>bikeshed/config/status.py from ..messages import * from .main import englishFromList shortToLongStatus = { "DREAM": "A Collection of Interesting Ideas", "LS": "Living Standard", "LS-COMMIT": "Commit Snapshot", "LS-BRANCH": "Branch Snapshot", "LS-PR": "PR Preview", "LD": "Living Docume...
<filename>bikeshed/config/status.py from ..messages import * from .main import englishFromList shortToLongStatus = { "DREAM": "A Collection of Interesting Ideas", "LS": "Living Standard", "LS-COMMIT": "Commit Snapshot", "LS-BRANCH": "Branch Snapshot", "LS-PR": "PR Preview", "LD": "Living Docume...
en
0.914699
# W3C statuses are restricted in various confusing ways. # These statuses are usable by any group operating under the W3C Process # Document. (So, not by Community and Business Groups.) # Interest Groups are limited to these statuses # Working Groups are limited to these statuses # The TAG is limited to these statuses ...
1.870436
2
aiodine/providers.py
Olegt0rr/aiodine
61
6629190
import inspect from contextlib import contextmanager, suppress from functools import partial from typing import ( TYPE_CHECKING, Any, AsyncGenerator, Awaitable, Callable, Dict, List, Optional, Union, ) from . import scopes from .compat import ( AsyncExitStack, wrap_async, ...
import inspect from contextlib import contextmanager, suppress from functools import partial from typing import ( TYPE_CHECKING, Any, AsyncGenerator, Awaitable, Callable, Dict, List, Optional, Union, ) from . import scopes from .compat import ( AsyncExitStack, wrap_async, ...
en
0.834726
# pragma: no cover Base class for providers. This is mostly a wrapper around a provider function, along with some metadata. Factory method to build a provider of the appropriate scope. # NOTE: the returned value is an awaitable, so we *must not* # declare this function as `async` — its return value should alre...
2.285346
2
app/models/role.py
Forec/WildPointer
8
6629191
# -*- coding: utf-8 -*- # @Time : 2017/9/6 09:49 # @Author : Forec # @File : models/role.py # @Project : WildPointer # @license : Copyright(C), Forec # @Contact : <EMAIL> from .permission import Permission from .. import db class Role(db.Model): __tablename__ = 'roles' id = db.Column(db.Integer, pri...
# -*- coding: utf-8 -*- # @Time : 2017/9/6 09:49 # @Author : Forec # @File : models/role.py # @Project : WildPointer # @license : Copyright(C), Forec # @Contact : <EMAIL> from .permission import Permission from .. import db class Role(db.Model): __tablename__ = 'roles' id = db.Column(db.Integer, pri...
fr
0.271143
# -*- coding: utf-8 -*- # @Time : 2017/9/6 09:49 # @Author : Forec # @File : models/role.py # @Project : WildPointer # @license : Copyright(C), Forec # @Contact : <EMAIL>
2.423122
2
pylot/loggers/camera_logger_operator.py
victorsun123/pylot
0
6629192
<reponame>victorsun123/pylot<filename>pylot/loggers/camera_logger_operator.py import numpy as np import pickle import PIL.Image as Image import pylot.utils from pylot.perception.segmentation.utils import transform_to_cityscapes_palette from erdos.op import Op from erdos.utils import setup_csv_logging, setup_logging ...
import numpy as np import pickle import PIL.Image as Image import pylot.utils from pylot.perception.segmentation.utils import transform_to_cityscapes_palette from erdos.op import Op from erdos.utils import setup_csv_logging, setup_logging class CameraLoggerOp(Op): """ Logs frames for different types of cameras....
en
0.662184
Logs frames for different types of cameras. # Write the image. # Write the image. # Write the image. # Write the segmented image. # Write the segmented image. # Write the depth information.
2.292632
2
mlrun/serving/states.py
Hedingber/mlrun
0
6629193
<filename>mlrun/serving/states.py # Copyright 2018 Iguazio # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
<filename>mlrun/serving/states.py # Copyright 2018 Iguazio # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
en
0.70146
# Copyright 2018 Iguazio # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softwa...
1.763054
2
lib/training/schemes/pattern/eig.py
shamim-hussain/egt
7
6629194
<reponame>shamim-hussain/egt<gh_stars>1-10 import tensorflow as tf from tensorflow.keras import (optimizers, losses, metrics) from tqdm import tqdm from sklearn.metrics import recall_score, accuracy_score, confusion_matrix import numpy as np import os from lib.base.dotdict import HDict from lib.data.datasets.sbm_patte...
import tensorflow as tf from tensorflow.keras import (optimizers, losses, metrics) from tqdm import tqdm from sklearn.metrics import recall_score, accuracy_score, confusion_matrix import numpy as np import os from lib.base.dotdict import HDict from lib.data.datasets.sbm_pattern import EigenDataset from lib.models.sbm_...
none
1
2.047554
2
problem_2/even_fibonacci.py
plilja/project-euler
0
6629195
from math import sqrt, log from common.functions import fibonacci PSI = (1.0 + sqrt(5)) / 2.0 def even_fibonacci(upper_limit): return even_fibonacci_mathematical(upper_limit) def sum_of_nth_first_fibonnaci_numbers(last_even_n): return fibonacci(last_even_n + 2) - 1 def even_fibonacci_mathematical(upper...
from math import sqrt, log from common.functions import fibonacci PSI = (1.0 + sqrt(5)) / 2.0 def even_fibonacci(upper_limit): return even_fibonacci_mathematical(upper_limit) def sum_of_nth_first_fibonnaci_numbers(last_even_n): return fibonacci(last_even_n + 2) - 1 def even_fibonacci_mathematical(upper...
none
1
3.804041
4
Hackerrank/30 Days of Code/30-inheritance.py
PROxZIMA/Competitive-Coding
1
6629196
class Person: def __init__(self, firstName, lastName, idNumber): self.firstName = firstName self.lastName = lastName self.idNumber = idNumber def printPerson(self): print("Name:", self.lastName + ",", self.firstName) print("ID:", self.idNumber) class Student(Person): def __init__(self, firstName, lastN...
class Person: def __init__(self, firstName, lastName, idNumber): self.firstName = firstName self.lastName = lastName self.idNumber = idNumber def printPerson(self): print("Name:", self.lastName + ",", self.firstName) print("ID:", self.idNumber) class Student(Person): def __init__(self, firstName, lastN...
none
1
3.697751
4
lib/private/copy_file.bzl
alexeagle/bazel-lib
0
6629197
# Copyright 2019 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
# Copyright 2019 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
en
0.83984
# Copyright 2019 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
1.664421
2
projects/forms/project.py
rogue26/processy.io
0
6629198
from django import forms from projects.models import Client, Project from bootstrap_modal_forms.forms import BSModalModelForm class DateInput(forms.DateInput): input_type = 'date' class ClientForm(forms.ModelForm): class Meta: model = Client exclude = ['timestamp'] class ProjectForm(forms....
from django import forms from projects.models import Client, Project from bootstrap_modal_forms.forms import BSModalModelForm class DateInput(forms.DateInput): input_type = 'date' class ClientForm(forms.ModelForm): class Meta: model = Client exclude = ['timestamp'] class ProjectForm(forms....
en
0.280405
# default date-format %m/%d/%Y will be used # To get request.user. Do not use kwargs.pop('user', None) due to potential security hole # default date-format %m/%d/%Y will be used
2.388418
2
smu/parser/smu_writer.py
pedersor/google-research
0
6629199
<reponame>pedersor/google-research # coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
en
0.761327
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
2.110134
2
02-Array/02-03-slice.py
xiaohui100/FluentPython
0
6629200
#!/usr/bin/env python # encoding: utf-8 """ @author: Alfons @contact: <EMAIL> @file: 02-03-slice.py @time: 2017/12/24 22:40 @version: v1.0 """ # 切片 s = "bicycle" slice_a = s[::3] slice_b = s[::-2] slice_c = s[::-1] print(slice_a) print(slice_b) print(slice_c) invoice = """ 1909 Pimoroni PiBrella $17.50 3 $52.5...
#!/usr/bin/env python # encoding: utf-8 """ @author: Alfons @contact: <EMAIL> @file: 02-03-slice.py @time: 2017/12/24 22:40 @version: v1.0 """ # 切片 s = "bicycle" slice_a = s[::3] slice_b = s[::-2] slice_c = s[::-1] print(slice_a) print(slice_b) print(slice_c) invoice = """ 1909 Pimoroni PiBrella $17.50 3 $52.5...
zh
0.4493
#!/usr/bin/env python # encoding: utf-8 @author: Alfons @contact: <EMAIL> @file: 02-03-slice.py @time: 2017/12/24 22:40 @version: v1.0 # 切片 1909 Pimoroni PiBrella $17.50 3 $52.50 1489 6mm Tactile Switch x20 $4.95 2 $9.90 1510 Panavise Jr. - PV-201 $28.00 1 $28.00 1601 PiTFT Mini Kit 320x240 $34.95 1 ...
3.391505
3
mything/feature.py
sdaves/mything-test-deploy
3
6629201
<gh_stars>1-10 # The MIT License (MIT) - Single File Copied # # Copyright (c) 2014 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation t...
# The MIT License (MIT) - Single File Copied # # Copyright (c) 2014 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to ...
en
0.687628
# The MIT License (MIT) - Single File Copied # # Copyright (c) 2014 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to ...
1.714139
2
generate_random_graphs.py
ls-cwi/lana
0
6629202
import itertools import random n_graphs = 5 n_nodes = 5000 p_edge_graph = 0.0008 p_edge_compatibility = 0.002 data_folder = "data/gen/" output_folder = "output/" def generate_random_graph(num_nodes, p_edge, name): print "Generating graph '%s'." % name nodes = range(0,num_nodes) edges = filter(lambda x: x...
import itertools import random n_graphs = 5 n_nodes = 5000 p_edge_graph = 0.0008 p_edge_compatibility = 0.002 data_folder = "data/gen/" output_folder = "output/" def generate_random_graph(num_nodes, p_edge, name): print "Generating graph '%s'." % name nodes = range(0,num_nodes) edges = filter(lambda x: x...
none
1
3.125388
3
src/gmit/re/com/Test.py
JoseIgnacioRetamalThomsen/Thompson-s-construction-
1
6629203
import unittest import Shunting import Thomsons import ThomsonsMap class Test(unittest.TestCase): @unittest.skip("feature not implemented") def test_no_dot_shunting(self): """ Test the use of no dot for concatenation on shunting algorithm. :return: Nothing. """ testCas...
import unittest import Shunting import Thomsons import ThomsonsMap class Test(unittest.TestCase): @unittest.skip("feature not implemented") def test_no_dot_shunting(self): """ Test the use of no dot for concatenation on shunting algorithm. :return: Nothing. """ testCas...
en
0.476878
Test the use of no dot for concatenation on shunting algorithm. :return: Nothing. # fail becuase overflow for multiple of 3 regex test # def test_isupper(self): # self.assertTrue('FOO'.isupper()) # self.assertFalse('Foo'.isupper()) # # def test_split(self): # s = 'hello world' # self.assertEqual...
3.27235
3
day_1/loop_control_flow.py
anishLearnsToCode/python-workshop-7
4
6629204
# continue # for i in range(1, 11): # if i == 4 or i == 8: # continue # print(i) # break # start = 0 # stop = 5 # step = 1 for number in range(5): print(number) if number > 2: break print('hello') print('i am outside loop') """ output 0 1 2 3 i am outside loop """
# continue # for i in range(1, 11): # if i == 4 or i == 8: # continue # print(i) # break # start = 0 # stop = 5 # step = 1 for number in range(5): print(number) if number > 2: break print('hello') print('i am outside loop') """ output 0 1 2 3 i am outside loop """
en
0.622223
# continue # for i in range(1, 11): # if i == 4 or i == 8: # continue # print(i) # break # start = 0 # stop = 5 # step = 1 output 0 1 2 3 i am outside loop
4.099514
4
miniature_potato/models.py
katerina7479/miniature-potato
0
6629205
<filename>miniature_potato/models.py from django.db import models from django.contrib.auth.models import User class Todo(models.Model): text = models.TextField() createdAt = models.DateTimeField('created_at', auto_now_add=True) completedAt = models.DateTimeField('completed_at', null=True) user = model...
<filename>miniature_potato/models.py from django.db import models from django.contrib.auth.models import User class Todo(models.Model): text = models.TextField() createdAt = models.DateTimeField('created_at', auto_now_add=True) completedAt = models.DateTimeField('completed_at', null=True) user = model...
none
1
2.162185
2
samples/bccharts_example_2.py
Richard-L-Johnson/pyalgotrader
3,719
6629206
from pyalgotrade import bar from pyalgotrade import strategy from pyalgotrade import plotter from pyalgotrade.technical import vwap from pyalgotrade.barfeed import csvfeed from pyalgotrade.bitstamp import broker from pyalgotrade import broker as basebroker class VWAPMomentum(strategy.BacktestingStrategy): MIN_TRA...
from pyalgotrade import bar from pyalgotrade import strategy from pyalgotrade import plotter from pyalgotrade.technical import vwap from pyalgotrade.barfeed import csvfeed from pyalgotrade.bitstamp import broker from pyalgotrade import broker as basebroker class VWAPMomentum(strategy.BacktestingStrategy): MIN_TRA...
none
1
2.305316
2
vantivsdk/pgp_helper.py
Devenlabo123/vantiv-sdk-for-python
0
6629207
<reponame>Devenlabo123/vantiv-sdk-for-python from subprocess import call from subprocess import check_output from subprocess import CalledProcessError import os from . import (utils) class PgpHelper(object): # Encrypt a file. def encryptFile(self, recipient, toBeEncryptedFilepath, outputFilepath): # Call gpg ...
from subprocess import call from subprocess import check_output from subprocess import CalledProcessError import os from . import (utils) class PgpHelper(object): # Encrypt a file. def encryptFile(self, recipient, toBeEncryptedFilepath, outputFilepath): # Call gpg command line to encrypt the file. try: ...
en
0.733389
# Encrypt a file. # Call gpg command line to encrypt the file. # Check for error code. # Handle gpg encryption when the output filename is the same as the input filename. # Decrypt an encrypted file. # Call gpg command line to decrypt the file. # Check for error code. # Add Vantiv public key into merchants' keyrings. #...
3.004093
3
main.py
Kimxons/passwd-locker
0
6629208
<gh_stars>0 #!/usr/bin/env python3.8 # vim: set fileencoding=<utf-8> : import string import random class User: ''' This Class contains user methods and attrs ''' user_info = [] def __init__(self,first,last,password): """ Information needed to create a password sa...
#!/usr/bin/env python3.8 # vim: set fileencoding=<utf-8> : import string import random class User: ''' This Class contains user methods and attrs ''' user_info = [] def __init__(self,first,last,password): """ Information needed to create a password saving object ...
en
0.792189
#!/usr/bin/env python3.8 # vim: set fileencoding=<utf-8> : This Class contains user methods and attrs Information needed to create a password saving object Create an instance of a new user Class that holds credential information and associated methods eg. add, remove and view creadentials Checks for matching credential...
3.609144
4
CeV - Gustavo Guanabara/exerc062.py
us19861229c/Meu-aprendizado-Python
1
6629209
print("Gerador de PA") i = int(input("Digite o termo: ")) p = int(input("Digite a razão: ")) termo = i cont = 1 total = 0 mais = 10 while mais != 0: total = total + mais while cont <= total: print(f"{cont}o. Termo: {termo}...", end="") termo += p cont += 1 print('Espera') mais =...
print("Gerador de PA") i = int(input("Digite o termo: ")) p = int(input("Digite a razão: ")) termo = i cont = 1 total = 0 mais = 10 while mais != 0: total = total + mais while cont <= total: print(f"{cont}o. Termo: {termo}...", end="") termo += p cont += 1 print('Espera') mais =...
none
1
3.826592
4
Exercicios em python/ex62.py
GabrielSantos25/Python
0
6629210
<reponame>GabrielSantos25/Python #Melhorada progressão aritmética em while termo = int(input('Informe o primeiro termo: ')) razao = int(input('Informe a razão: ')) primeiro = termo cont = 1 novo = 10 total = 0 while novo != 0: total += novo while cont <= total: print(f'{primeiro}', end=' -> ') p...
#Melhorada progressão aritmética em while termo = int(input('Informe o primeiro termo: ')) razao = int(input('Informe a razão: ')) primeiro = termo cont = 1 novo = 10 total = 0 while novo != 0: total += novo while cont <= total: print(f'{primeiro}', end=' -> ') primeiro += razao cont += ...
pt
0.99903
#Melhorada progressão aritmética em while
3.882782
4
S4/S4 Library/simulation/venues/chalet_garden/chalet_garden_situation.py
NeonOcean/Environment
1
6629211
from sims4.tuning.instances import lock_instance_tunables from sims4.tuning.tunable import TunableReference from sims4.tuning.tunable_base import GroupNames from situations.bouncer.bouncer_types import RequestSpawningOption, BouncerRequestPriority, BouncerExclusivityCategory from situations.situation import Situation f...
from sims4.tuning.instances import lock_instance_tunables from sims4.tuning.tunable import TunableReference from sims4.tuning.tunable_base import GroupNames from situations.bouncer.bouncer_types import RequestSpawningOption, BouncerRequestPriority, BouncerExclusivityCategory from situations.situation import Situation f...
none
1
2.200637
2
checkout/tests/factories.py
kevin-ci/janeric2
1
6629212
import factory from faker import Faker from factory import lazy_attribute from products.tests.factories import ( CategoryFactory, Product_FamilyFactory, ProductFactory, ) fake = Faker() quantity = factory.Faker("random_int", min=1, max=50) #quantity = factory.LazyAttribute(lambda x: random.randrange(...
import factory from faker import Faker from factory import lazy_attribute from products.tests.factories import ( CategoryFactory, Product_FamilyFactory, ProductFactory, ) fake = Faker() quantity = factory.Faker("random_int", min=1, max=50) #quantity = factory.LazyAttribute(lambda x: random.randrange(...
en
0.162794
#quantity = factory.LazyAttribute(lambda x: random.randrange(1, 30))
2.373216
2
app.py
Build-Week-Spotify-Song-Suggester-01/back-end
1
6629213
# import statements from flask import Flask, render_template, request from spotipy.oauth2 import SpotifyClientCredentials import spotipy import matplotlib.pyplot as plt import numpy as np # making and configuring flask app app = Flask(__name__) app.config['DEBUG'] = True app.config['EXPLAIN_TEMPLATE_LOADING'] = True ...
# import statements from flask import Flask, render_template, request from spotipy.oauth2 import SpotifyClientCredentials import spotipy import matplotlib.pyplot as plt import numpy as np # making and configuring flask app app = Flask(__name__) app.config['DEBUG'] = True app.config['EXPLAIN_TEMPLATE_LOADING'] = True ...
en
0.877218
# import statements # making and configuring flask app # token for Spotify API # connecting to Spotipy using token Function to use .recommendations() to return 5 similar songs # .recommendations returns 5 similar songs # for loop to return track id, title, artist and the url # for song recommendations Function to g...
3.288523
3
data/utils.py
jlorenze/asl_fixedwing
4
6629214
from os.path import dirname, abspath, join, isfile, isdir import sys import rosbag import numpy as np def get_data_dir(): return dirname(abspath(__file__)) def get_models_dir(): return join(dirname(dirname(abspath(__file__))), 'models') def get_utils_dir(): return join(dirname(dirname(abspath(__file__)))...
from os.path import dirname, abspath, join, isfile, isdir import sys import rosbag import numpy as np def get_data_dir(): return dirname(abspath(__file__)) def get_models_dir(): return join(dirname(dirname(abspath(__file__))), 'models') def get_utils_dir(): return join(dirname(dirname(abspath(__file__)))...
en
0.633108
A class to extract data from Plane topic messages # inertial pos x_i, y_i, z_i [m] # body frame vel u, v, w [m/s] # euler angle phi, th, psi [rad] # body rate p, q, r [rad/s] # thrust [N] and ctrl srf def [rad] # normalized actuators # Total velocity Add a piece of data from a ROS message A class to extract data from R...
2.765501
3
6_ObjectOriented/exceptions.py
felixdittrich92/Python3
1
6629215
<filename>6_ObjectOriented/exceptions.py import numbers import builtins from math import sqrt from functools import total_ordering @total_ordering class Vector2D: def __init__(self, x=0, y=0): if isinstance(x, numbers.Real) and isinstance(y, numbers.Real): # Numbers.Real = reele Zahl self.x =...
<filename>6_ObjectOriented/exceptions.py import numbers import builtins from math import sqrt from functools import total_ordering @total_ordering class Vector2D: def __init__(self, x=0, y=0): if isinstance(x, numbers.Real) and isinstance(y, numbers.Real): # Numbers.Real = reele Zahl self.x =...
de
0.868178
# Numbers.Real = reele Zahl # welche Exception geworfen werden soll # überprüfen ob Vector # überprüfen ob Vector # überprüfen ob Vector # try (== 1): # except (>= 1): # finally (optional): # wird immer am Schluss ausgeführt # Werterror wenn 0 # alle Exceptions # v3 = Vector2D('S', 'e')
3.371463
3
coworker/place/apps.py
flybackl/spacesmap
0
6629216
from django.apps import AppConfig class PlaceConfig(AppConfig): name = 'coworker.place'
from django.apps import AppConfig class PlaceConfig(AppConfig): name = 'coworker.place'
none
1
1.17902
1
src/SyntOn_Classifier.py
docking-org/SynthI
0
6629217
<gh_stars>0 from rdkit import Chem from rdkit.Chem.rdMolDescriptors import * import os, json,sys srcPath = os.path.split(os.path.realpath(__file__))[0] sys.path.insert(1, srcPath) from UsefulFunctions import * def main(args): for ind, line in enumerate(open(args.input)): sline = line.strip() ...
from rdkit import Chem from rdkit.Chem.rdMolDescriptors import * import os, json,sys srcPath = os.path.split(os.path.realpath(__file__))[0] sys.path.insert(1, srcPath) from UsefulFunctions import * def main(args): for ind, line in enumerate(open(args.input)): sline = line.strip() if sline...
zh
0.207444
#q3.UpdatePropertyCache()
2.40993
2
python/testData/resolve/multiFile/moduleValueCollision/ModuleValueCollision.py
jnthn/intellij-community
2
6629218
# we import a value from boo import BOO print(BOO) # <ref>
# we import a value from boo import BOO print(BOO) # <ref>
es
0.241152
# we import a value # <ref>
1.550741
2
haystack/sites.py
disqus/django-haystack
1
6629219
<reponame>disqus/django-haystack import copy from haystack.exceptions import AlreadyRegistered, NotRegistered, SearchFieldError class SearchSite(object): """ Encapsulates all the indexes that should be available. This allows you to register indexes on models you don't control (reusable apps, djan...
import copy from haystack.exceptions import AlreadyRegistered, NotRegistered, SearchFieldError class SearchSite(object): """ Encapsulates all the indexes that should be available. This allows you to register indexes on models you don't control (reusable apps, django.contrib, etc.) as well as cust...
en
0.879646
Encapsulates all the indexes that should be available. This allows you to register indexes on models you don't control (reusable apps, django.contrib, etc.) as well as customize on a per-site basis what indexes should be available (different indexes for different sites, same codebase). A S...
2.271499
2
FictionTools/amitools/test/unit/path_mgr.py
polluks/Puddle-BuildTools
38
6629220
<filename>FictionTools/amitools/test/unit/path_mgr.py import os import pytest from amitools.vamos.path import * from amitools.vamos.cfgcore import ConfigDict import logging from amitools.vamos.log import log_path log_path.setLevel(logging.DEBUG) def path_mgr_default_test(): pm = PathManager() assert pm.get_...
<filename>FictionTools/amitools/test/unit/path_mgr.py import os import pytest from amitools.vamos.path import * from amitools.vamos.cfgcore import ConfigDict import logging from amitools.vamos.log import log_path log_path.setLevel(logging.DEBUG) def path_mgr_default_test(): pm = PathManager() assert pm.get_...
en
0.554457
# local volume # local volume # prefix # volume # assign # valid # shutdown # recursive # shutdown # abspath of abs # abspath of rel # invalid rel # assign # other volpath # shutdown # relpath # relpath own env # invalid relpath # volpath # multi assign # assign # unknown prefix # strict: unknown prefix # shutdown # re...
2.002767
2
tools/populate_default.py
jalvinronnie/SU-Portal
0
6629221
from app.models import User from simpleticket.models import Priority from simpleticket.models import Project from simpleticket.models import Status project = Project.objects.create(name='default_project') project.is_default = True project.save() priority = Priority.objects.create(name='default_priority') priority.is_...
from app.models import User from simpleticket.models import Priority from simpleticket.models import Project from simpleticket.models import Status project = Project.objects.create(name='default_project') project.is_default = True project.save() priority = Priority.objects.create(name='default_priority') priority.is_...
none
1
2.189544
2
gammapy/irf/psf_table.py
watsonjj/gammapy
0
6629222
# Licensed under a 3-clause BSD style license - see LICENSE.rst import logging import numpy as np from astropy.io import fits from astropy import units as u from astropy.coordinates import Angle from astropy.utils import lazyproperty from scipy.integrate import cumtrapz from ..utils.interpolation import ScaledRegularGr...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import logging import numpy as np from astropy.io import fits from astropy import units as u from astropy.coordinates import Angle from astropy.utils import lazyproperty from scipy.integrate import cumtrapz from ..utils.interpolation import ScaledRegularGr...
en
0.410042
# Licensed under a 3-clause BSD style license - see LICENSE.rst Radially-symmetric table PSF. Parameters ---------- rad : `~astropy.units.Quantity` with angle units Offset wrt source position psf_value : `~astropy.units.Quantity` with sr^-1 units PSF value array interp_kwargs : dict...
2.132038
2
JumpScale9Lib/clients/etcd/EtcdFactory.py
Jumpscale/lib9
2
6629223
<reponame>Jumpscale/lib9 from js9 import j from .EtcdClient import EtcdClient JSConfigFactoryBase = j.tools.configmanager.base_class_configs class EtcdFactory(JSConfigFactoryBase): def __init__(self): self.__jslocation__ = "j.clients.etcd" super().__init__(child_class=EtcdClient)
from js9 import j from .EtcdClient import EtcdClient JSConfigFactoryBase = j.tools.configmanager.base_class_configs class EtcdFactory(JSConfigFactoryBase): def __init__(self): self.__jslocation__ = "j.clients.etcd" super().__init__(child_class=EtcdClient)
none
1
1.710135
2
landlord/migrations/0009_auto_20210608_0749.py
manishwins/Greenline
0
6629224
<gh_stars>0 # Generated by Django 3.1.7 on 2021-06-08 07:49 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('landlord', '0008_auto_20210607_1050'), ] operations = [ migrations.AddField( model_name='properties', na...
# Generated by Django 3.1.7 on 2021-06-08 07:49 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('landlord', '0008_auto_20210607_1050'), ] operations = [ migrations.AddField( model_name='properties', name='address'...
en
0.781074
# Generated by Django 3.1.7 on 2021-06-08 07:49
1.54682
2
kattis/kemija.py
terror/Solutions
2
6629225
<reponame>terror/Solutions s = input() s = s.replace('apa', 'a').replace('epe', 'e').replace('ipi', 'i').replace('opo', 'o').replace('upu', 'u') print(s)
s = input() s = s.replace('apa', 'a').replace('epe', 'e').replace('ipi', 'i').replace('opo', 'o').replace('upu', 'u') print(s)
none
1
3.529792
4
src/OV7670FIFO.py
ESPuPy/ESP32WiFiCAM-OV7670
3
6629226
<reponame>ESPuPy/ESP32WiFiCAM-OV7670 #------------------------------------------- # # ESP32 WiFi Camera (OV7670 FIFO Version) # ESP32WiFiCAM-OV7670 # # file:OV7670FIFO.py # from machine import Pin import utime class OV7670FIFO(): """OV7670 FIFO Conrol class""" def __init__(self, spi, vsync, rdclk...
#------------------------------------------- # # ESP32 WiFi Camera (OV7670 FIFO Version) # ESP32WiFiCAM-OV7670 # # file:OV7670FIFO.py # from machine import Pin import utime class OV7670FIFO(): """OV7670 FIFO Conrol class""" def __init__(self, spi, vsync, rdclk, we, rrst, wrst, pl): self....
en
0.307006
#------------------------------------------- # # ESP32 WiFi Camera (OV7670 FIFO Version) # ESP32WiFiCAM-OV7670 # # file:OV7670FIFO.py # OV7670 FIFO Conrol class # OV VSYNC No39 # FIFO ReadClock No0 # FIFO Write Enable No26 # FIFO ReadReset No21 # FIFO Write Reset No22 # TTL PL No25 #...
2.59782
3
src/ipyradiant/__init__.py
RhythmSyed/ipyradiant
0
6629227
""" ipyradiant main file """ # Copyright (c) 2020 ipyradiant contributors. # Distributed under the terms of the Modified BSD License. from ._version import __version__ from .basic_tools import ( CustomURIRef, MultiPanelSelect, PredicateMultiselectApp, collapse_predicates, ) from .loader import FileMana...
""" ipyradiant main file """ # Copyright (c) 2020 ipyradiant contributors. # Distributed under the terms of the Modified BSD License. from ._version import __version__ from .basic_tools import ( CustomURIRef, MultiPanelSelect, PredicateMultiselectApp, collapse_predicates, ) from .loader import FileMana...
en
0.757013
ipyradiant main file # Copyright (c) 2020 ipyradiant contributors. # Distributed under the terms of the Modified BSD License.
1.055114
1
roblox/abc.py
jpatrickdill/roblox.py
1
6629228
# ABC classes for Roblox from __future__ import annotations from abc import ABCMeta, abstractmethod from datetime import datetime from typing import AsyncGenerator, Optional, List, Union from roblox.enums import AssetType class User(metaclass=ABCMeta): """An ABC that details common operations on a Roblox user....
# ABC classes for Roblox from __future__ import annotations from abc import ABCMeta, abstractmethod from datetime import datetime from typing import AsyncGenerator, Optional, List, Union from roblox.enums import AssetType class User(metaclass=ABCMeta): """An ABC that details common operations on a Roblox user....
en
0.84417
# ABC classes for Roblox An ABC that details common operations on a Roblox user. # @classmethod # def __subclasshook__(cls, C): # if cls is User: # mro = C.__mro__ # for attr in ("username", "id", "description", "status", "created_at", "banned"): # for base in mro: # if a...
2.825297
3
11/11a.py
atnguyen1/Adventofcode2020
0
6629229
#!/usr/bin/env python3 import argparse import numpy as np from collections import Counter import sys np.set_printoptions(threshold=sys.maxsize) class gameoflife: def __init__(self, input_grid): # . = ground == 0 # L = seat == 1 # # = occupied == 2 self.raw_input = input_grid ...
#!/usr/bin/env python3 import argparse import numpy as np from collections import Counter import sys np.set_printoptions(threshold=sys.maxsize) class gameoflife: def __init__(self, input_grid): # . = ground == 0 # L = seat == 1 # # = occupied == 2 self.raw_input = input_grid ...
en
0.778948
#!/usr/bin/env python3 # . = ground == 0 # L = seat == 1 # # = occupied == 2 # Construct grid that has 1x padding on all sides to avoid bounds # Top Row # Bottom Row # Use a new copy to fill seats, swap at the end # Ignore cells on border # Ground # Check the following cells # 1 2 3 # 4 5 # 6 7 8 # Check in numerical...
3.010137
3
CursoSolyd/ex_aula_9_orientacao_a_objetos/main.py
cirino/python
1
6629230
from banco import Conta print(''' Exercício 09 de Python Curso da Solyd Day 22 Code Python - 21/05/2018 ''') cliente1 = Conta(12345, 'dag', 29) print(cliente1.cpf) print(cliente1.nome) print(cliente1.idade) print(cliente1.saldo) cliente1.deposito(2200) print(cliente1.saldo) cliente1.sacar(1300) print(c...
from banco import Conta print(''' Exercício 09 de Python Curso da Solyd Day 22 Code Python - 21/05/2018 ''') cliente1 = Conta(12345, 'dag', 29) print(cliente1.cpf) print(cliente1.nome) print(cliente1.idade) print(cliente1.saldo) cliente1.deposito(2200) print(cliente1.saldo) cliente1.sacar(1300) print(c...
pt
0.537495
Exercício 09 de Python Curso da Solyd Day 22 Code Python - 21/05/2018
3.070263
3
tests/flow/test_ts_madd.py
elena-kolevska/RedisTimeSeries
643
6629231
<reponame>elena-kolevska/RedisTimeSeries import time from RLTest import Env def test_madd(): sample_len = 1024 Env().skipOnCluster() with Env().getConnection() as r: r.execute_command("ts.create", 'test_key1') r.execute_command("ts.create", 'test_key2') r.execute_command("ts.creat...
import time from RLTest import Env def test_madd(): sample_len = 1024 Env().skipOnCluster() with Env().getConnection() as r: r.execute_command("ts.create", 'test_key1') r.execute_command("ts.create", 'test_key2') r.execute_command("ts.create", 'test_key3') for i in range(...
none
1
1.962278
2
raspberry/IoT-workshop-BR_BSB-20150803/blink_led_simple.py
mtulio/kb
3
6629232
#!/usr/bin/python import RPi.GPIO as Portas Portas.setmode(Portas.BOARD); Portas.setup(24,Portas.OUT); #Portas.output(24,True); Portas.output(24,False);
#!/usr/bin/python import RPi.GPIO as Portas Portas.setmode(Portas.BOARD); Portas.setup(24,Portas.OUT); #Portas.output(24,True); Portas.output(24,False);
ru
0.128539
#!/usr/bin/python #Portas.output(24,True);
1.967765
2
examples/python-guide/dask/multiclass-classification.py
PyVCEchecker/LightGBM
8,890
6629233
import dask.array as da from distributed import Client, LocalCluster from sklearn.datasets import make_blobs import lightgbm as lgb if __name__ == "__main__": print("loading data") X, y = make_blobs(n_samples=1000, n_features=50, centers=3) print("initializing a Dask cluster") cluster = LocalCluste...
import dask.array as da from distributed import Client, LocalCluster from sklearn.datasets import make_blobs import lightgbm as lgb if __name__ == "__main__": print("loading data") X, y = make_blobs(n_samples=1000, n_features=50, centers=3) print("initializing a Dask cluster") cluster = LocalCluste...
none
1
2.696907
3
tests.py
edberoi/python-airmusicapi
0
6629234
""" Test file to check functionality in Airmusic API towards Lenco DIR150BK. """ import json import logging import time from airmusicapi import airmusic IPADDR = '192.168.2.147' # Change this to the IP-address or hostname of your device. TIMEOUT = 5 # in seconds. In most cases 1 second is sufficient. def print_...
""" Test file to check functionality in Airmusic API towards Lenco DIR150BK. """ import json import logging import time from airmusicapi import airmusic IPADDR = '192.168.2.147' # Change this to the IP-address or hostname of your device. TIMEOUT = 5 # in seconds. In most cases 1 second is sufficient. def print_...
en
0.774386
Test file to check functionality in Airmusic API towards Lenco DIR150BK. # Change this to the IP-address or hostname of your device. # in seconds. In most cases 1 second is sufficient. ! Show the response from a list command in pretty print format. @param list_result contains the result (dict) of the 'list' com...
2.818831
3
testcenter_multithread/sequencer.py
kelakty/Testcenter
0
6629235
<reponame>kelakty/Testcenter from PyQt5.QtCore import QObject from PyQt5.QtCore import QThread,pyqtSignal,QStandardPaths from PyQt5.QtWidgets import QWidget,QFileDialog,QMessageBox from globalvariable import GlobalVariable import threading import time import re import pandas as pd from datetime import datetime # test...
from PyQt5.QtCore import QObject from PyQt5.QtCore import QThread,pyqtSignal,QStandardPaths from PyQt5.QtWidgets import QWidget,QFileDialog,QMessageBox from globalvariable import GlobalVariable import threading import time import re import pandas as pd from datetime import datetime # test_sequence = [{"是否测试":True, "N...
en
0.195217
# test_sequence = [{"是否测试":True, "Name":"COM2", "SerialObj":"obj", "发送指令":"1","等待回显时间":1, "需匹配文本":"", "NoMatchLog":"Fail", "ClearLogBuffer":True, "SaveFile":"xxx.log", "Report":"xxx.xls"}, # {"是否测试":True, "Name":"COM2", "SerialObj":"obj", "发送指令":"2","等待回显时间":1, "需匹配文本":"interface", "ClearLogBuffer":True...
2.342592
2
bzt/modules/selenium.py
gulraiz14/Taurus
0
6629236
""" Copyright 2015 BlazeMeter Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
""" Copyright 2015 BlazeMeter Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
en
0.659566
Copyright 2015 BlazeMeter Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dis...
1.507648
2
tests/test_run.py
SeanDS/python-ngspice
0
6629237
<filename>tests/test_run.py """Run function tests. Note: tests of the behaviour in running simulations (e.g. error handling) should instead go in `test_session.py`. """ from io import StringIO from itertools import zip_longest import pytest from ngspice import run, run_file, SimulationError from ngspice.testing impor...
<filename>tests/test_run.py """Run function tests. Note: tests of the behaviour in running simulations (e.g. error handling) should instead go in `test_session.py`. """ from io import StringIO from itertools import zip_longest import pytest from ngspice import run, run_file, SimulationError from ngspice.testing impor...
en
0.681992
Run function tests. Note: tests of the behaviour in running simulations (e.g. error handling) should instead go in `test_session.py`. Test script R1 n1 n2 1k R2 n2 0 10k V1 n1 0 DC 1 .op .end Run netlist from string. Run netlist from path string. Run netlist ...
2.777707
3
smilepack/utils/uploader.py
andreymal/smilepack
0
6629238
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import time from io import BytesIO from hashlib import sha256 from urllib.request import urlopen, Request from flask import current_app class BadImageError(Exception): pass class Uploader(object): def __init__(self, method, directory, maxbytes, minr...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import time from io import BytesIO from hashlib import sha256 from urllib.request import urlopen, Request from flask import current_app class BadImageError(Exception): pass class Uploader(object): def __init__(self, method, directory, maxbytes, minr...
ru
0.968529
#!/usr/bin/env python3 # -*- coding: utf-8 -*- Параметры загрузки: * method — None, 'imgur' или 'directory' — куда сохранять картинку (None означает отсутствие сохранения и требует url) * directory — каталог, в который будет сохранена картинка, для метода directory * maxbytes — максимальный разм...
2.520285
3
sdk/communication/azure-communication-networktraversal/azure/communication/networktraversal/_generated/models/_models.py
moovy2/azure-sdk-for-python
2,728
6629239
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
en
0.607889
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
2.102725
2
pkgcore/test/restrictions/test_util.py
pombreda/pkgcore
1
6629240
<filename>pkgcore/test/restrictions/test_util.py # Copyright: 2006 <NAME> <<EMAIL>> # License: GPL2/BSD from pkgcore.restrictions import util, packages, values from pkgcore.test import TestCase class Test_collect_package_restrictions(TestCase): def test_collect_all(self): prs = [packages.PackageRestrict...
<filename>pkgcore/test/restrictions/test_util.py # Copyright: 2006 <NAME> <<EMAIL>> # License: GPL2/BSD from pkgcore.restrictions import util, packages, values from pkgcore.test import TestCase class Test_collect_package_restrictions(TestCase): def test_collect_all(self): prs = [packages.PackageRestrict...
en
0.275257
# Copyright: 2006 <NAME> <<EMAIL>> # License: GPL2/BSD
2.093761
2
uniter_model/tests/generate_test_data.py
intersun/LightningDOT
64
6629241
""" minimal running script of distributed training """ import argparse import random import torch from torch import nn from torch.nn import functional as F from torch.nn.utils.rnn import pad_sequence from torch import optim # communication operations from utils.distributed import all_reduce_and_rescale_tensors, all_g...
""" minimal running script of distributed training """ import argparse import random import torch from torch import nn from torch.nn import functional as F from torch.nn.utils.rnn import pad_sequence from torch import optim # communication operations from utils.distributed import all_reduce_and_rescale_tensors, all_g...
en
0.897708
minimal running script of distributed training # communication operations
2.459665
2
iter8_analytics/api/analytics/metrics.py
huang195/iter8-analytics
0
6629242
"""Module containing classes and methods for querying prometheus and returning metric data. """ # core python dependencies from datetime import datetime, timedelta, timezone from uuid import UUID from typing import Dict, Iterable, Any, Union import logging import requests from string import Template import math # ext...
"""Module containing classes and methods for querying prometheus and returning metric data. """ # core python dependencies from datetime import datetime, timedelta, timezone from uuid import UUID from typing import Dict, Iterable, Any, Union import logging import requests from string import Template import math # ext...
en
0.699964
Module containing classes and methods for querying prometheus and returning metric data. # core python dependencies # external module dependencies # iter8 dependencies Return min and max for each ratio metric Args: metric_id_to_list_of_values (Dict[iter8d, Iterable[float]]): dictionary whose keys are metri...
2.794782
3
ckanext/datastore/logic/auth.py
florianm/ckan
3
6629243
import ckan.plugins as p def datastore_auth(context, data_dict, privilege='resource_update'): if not 'id' in data_dict: data_dict['id'] = data_dict.get('resource_id') user = context.get('user') authorized = p.toolkit.check_access(privilege, context, data_dict) if not authorized: ret...
import ckan.plugins as p def datastore_auth(context, data_dict, privilege='resource_update'): if not 'id' in data_dict: data_dict['id'] = data_dict.get('resource_id') user = context.get('user') authorized = p.toolkit.check_access(privilege, context, data_dict) if not authorized: ret...
none
1
2.043536
2
GetData/DataFromTS.py
MarcusErz/TimeSeriesData
0
6629244
import math import numpy as np from sklearn.manifold import Isomap from sklearn.preprocessing import StandardScaler def data_from_ts(ts_values, window_size): len_ts = len(ts_values) len_networks = math.ceil(len_ts / window_size) networks = [] print(len_networks) for i in range(0, len_ts, window_si...
import math import numpy as np from sklearn.manifold import Isomap from sklearn.preprocessing import StandardScaler def data_from_ts(ts_values, window_size): len_ts = len(ts_values) len_networks = math.ceil(len_ts / window_size) networks = [] print(len_networks) for i in range(0, len_ts, window_si...
de
0.962331
# normalize # TODO Die Elemente auf der Hauptdiagonalen sollten eigentlich gleich sein sind sie aber nicht # print('sparsify net: {}'.format(sparsify_net)) # TODO is std a good solution
2.698492
3
entomb/processing.py
countermeasure/entomb
0
6629245
import datetime import os import subprocess from entomb import ( exceptions, utilities, ) @utilities.hide_cursor() def process_objects(path, immutable, include_git, dry_run): """Set or unset the immutable attribute for all files on a path. Parameters ---------- path : str An absolute...
import datetime import os import subprocess from entomb import ( exceptions, utilities, ) @utilities.hide_cursor() def process_objects(path, immutable, include_git, dry_run): """Set or unset the immutable attribute for all files on a path. Parameters ---------- path : str An absolute...
en
0.766857
Set or unset the immutable attribute for all files on a path. Parameters ---------- path : str An absolute path. immutable: bool Set immutable attributes if True, unset immutable attributes if False. include_git: bool Whether to include git files and directories. dry_run...
2.494737
2
tebless/examples/menu.py
Akhail/Tebless
5
6629246
<reponame>Akhail/Tebless # Copyright (c) 2017 <NAME> # # This software is released under the MIT License. # https://opensource.org/licenses/MIT from tebless.devs import init_debug from tebless.utils import Store from tebless.themes.menu import double from tebless.widgets import Menu, Window, Label store = Store() @...
# Copyright (c) 2017 <NAME> # # This software is released under the MIT License. # https://opensource.org/licenses/MIT from tebless.devs import init_debug from tebless.utils import Store from tebless.themes.menu import double from tebless.widgets import Menu, Window, Label store = Store() @Window.decorator(store=st...
en
0.859002
# Copyright (c) 2017 <NAME> # # This software is released under the MIT License. # https://opensource.org/licenses/MIT
2.455064
2
test_package/conanfile.py
Tymolc/conan-depot_tools_installer
1
6629247
from conans import ConanFile import os class TestPackage(ConanFile): def test(self): self.run("gclient --version", run_environment=True)
from conans import ConanFile import os class TestPackage(ConanFile): def test(self): self.run("gclient --version", run_environment=True)
none
1
1.626222
2
LeetCode/python-R1/0561-数组拆分1/V2.py
huuuuusy/Programming-Practice-Everyday
4
6629248
<reponame>huuuuusy/Programming-Practice-Everyday<filename>LeetCode/python-R1/0561-数组拆分1/V2.py """ @Author: huuuuusy @GitHub: https://github.com/huuuuusy 系统: Ubuntu 18.04 IDE: VS Code 1.36 工具: python == 3.7.3 """ """ 思路: 先排序 对排序结果,第0,2,4,...个元素是每对的最小值 利用切片提取结果,然后求和即可 结果: 执行用时 : 128 ms, 在所有 Python3 提交中...
""" @Author: huuuuusy @GitHub: https://github.com/huuuuusy 系统: Ubuntu 18.04 IDE: VS Code 1.36 工具: python == 3.7.3 """ """ 思路: 先排序 对排序结果,第0,2,4,...个元素是每对的最小值 利用切片提取结果,然后求和即可 结果: 执行用时 : 128 ms, 在所有 Python3 提交中击败了88.15%的用户 内存消耗 : 15 MB, 在所有 Python3 提交中击败了56.00%的用户 """ class Solution: def arrayP...
zh
0.908651
@Author: huuuuusy @GitHub: https://github.com/huuuuusy 系统: Ubuntu 18.04 IDE: VS Code 1.36 工具: python == 3.7.3 思路: 先排序 对排序结果,第0,2,4,...个元素是每对的最小值 利用切片提取结果,然后求和即可 结果: 执行用时 : 128 ms, 在所有 Python3 提交中击败了88.15%的用户 内存消耗 : 15 MB, 在所有 Python3 提交中击败了56.00%的用户
3.576692
4
catalog/migrations/0013_auto_20160926_1901.py
starpolar/django-registration
1
6629249
<filename>catalog/migrations/0013_auto_20160926_1901.py # -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-09-26 09:01 from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('catalog', '...
<filename>catalog/migrations/0013_auto_20160926_1901.py # -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-09-26 09:01 from __future__ import unicode_literals import datetime from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('catalog', '...
en
0.808435
# -*- coding: utf-8 -*- # Generated by Django 1.10 on 2016-09-26 09:01
1.456267
1
samtranslator/swagger/swagger.py
giuliocalzolari/serverless-application-model
2
6629250
import copy from six import string_types from samtranslator.model.intrinsics import ref class SwaggerEditor(object): """ Wrapper class capable of parsing and generating Swagger JSON. This implements Swagger spec just enough that SAM cares about. It is built to handle "partial Swagger" ie. Swagger that i...
import copy from six import string_types from samtranslator.model.intrinsics import ref class SwaggerEditor(object): """ Wrapper class capable of parsing and generating Swagger JSON. This implements Swagger spec just enough that SAM cares about. It is built to handle "partial Swagger" ie. Swagger that i...
en
0.767096
Wrapper class capable of parsing and generating Swagger JSON. This implements Swagger spec just enough that SAM cares about. It is built to handle "partial Swagger" ie. Swagger that is incomplete and won't pass the Swagger spec. But this is necessary for SAM because it iteratively builds the Swagger starting f...
2.339125
2