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
pyxdsm/tests/test_xdsm.py
yqliaohk/pyXDSM
0
7500
import unittest import os from pyxdsm.XDSM import XDSM, __file__ from numpy.distutils.exec_command import find_executable def filter_lines(lns): # Empty lines are excluded. # Leading and trailing whitespaces are removed # Comments are removed. return [ln.strip() for ln in lns if ln.strip() and not ln....
import unittest import os from pyxdsm.XDSM import XDSM, __file__ from numpy.distutils.exec_command import find_executable def filter_lines(lns): # Empty lines are excluded. # Leading and trailing whitespaces are removed # Comments are removed. return [ln.strip() for ln in lns if ln.strip() and not ln....
en
0.505954
# Empty lines are excluded. # Leading and trailing whitespaces are removed # Comments are removed. This test just builds the three examples, and assert that the output files exist. Unlike the other tests, this one requires LaTeX to be available. # look for the pdflatex executable # if no pdflatex, then do not a...
2.32417
2
wecom_sdk/base/callback.py
quanttide/wecom-sdk-py
9
7501
# -*- coding: utf-8 -*- from wecom_sdk.base.crypt import encrypt_msg, decrypt_msg class WeChatWorkCallbackSDK(object): """ 企业微信回调SDK基本类,用于实现内部系统和企业微信客户端的双向通信 详细说明:https://work.weixin.qq.com/api/doc/90000/90135/90930 """ def __init__(self, token, encoding_aes_key): self.token = token ...
# -*- coding: utf-8 -*- from wecom_sdk.base.crypt import encrypt_msg, decrypt_msg class WeChatWorkCallbackSDK(object): """ 企业微信回调SDK基本类,用于实现内部系统和企业微信客户端的双向通信 详细说明:https://work.weixin.qq.com/api/doc/90000/90135/90930 """ def __init__(self, token, encoding_aes_key): self.token = token ...
zh
0.634491
# -*- coding: utf-8 -*- 企业微信回调SDK基本类,用于实现内部系统和企业微信客户端的双向通信 详细说明:https://work.weixin.qq.com/api/doc/90000/90135/90930 服务端加密数据 :param data: :param timestamp: :param nonce: :return: 验证并解密来自客户端的数据 :return:
2.32582
2
scripts/get-table-schemas.py
numankh/GRE-Vocab-Helper
0
7502
<gh_stars>0 import psycopg2 from decouple import config import pandas as pd import dbconnect cursor, connection = dbconnect.connect_to_db() sql = """ SELECT "table_name","column_name", "data_type", "table_schema" FROM INFORMATION_SCHEMA.COLUMNS WHERE "table_schema" = 'public' ORDER BY table_name """ df = pd.read_sql...
import psycopg2 from decouple import config import pandas as pd import dbconnect cursor, connection = dbconnect.connect_to_db() sql = """ SELECT "table_name","column_name", "data_type", "table_schema" FROM INFORMATION_SCHEMA.COLUMNS WHERE "table_schema" = 'public' ORDER BY table_name """ df = pd.read_sql(sql, con=co...
en
0.564946
SELECT "table_name","column_name", "data_type", "table_schema" FROM INFORMATION_SCHEMA.COLUMNS WHERE "table_schema" = 'public' ORDER BY table_name
3.039368
3
tests/test_table/test_pivot.py
andriyor/agate
663
7503
<gh_stars>100-1000 #!/usr/bin/env python # -*- coding: utf8 -*- import sys try: from cdecimal import Decimal except ImportError: # pragma: no cover from decimal import Decimal from agate import Table from agate.aggregations import Sum from agate.computations import Percent from agate.data_types import Numbe...
#!/usr/bin/env python # -*- coding: utf8 -*- import sys try: from cdecimal import Decimal except ImportError: # pragma: no cover from decimal import Decimal from agate import Table from agate.aggregations import Sum from agate.computations import Percent from agate.data_types import Number, Text from agate....
en
0.302971
#!/usr/bin/env python # -*- coding: utf8 -*- # pragma: no cover
2.295288
2
external/pyTorchChamferDistance/chamfer_distance/__init__.py
chengzhag/DeepPanoContext
52
7504
import os os.makedirs(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'build')), exist_ok=True) from .chamfer_distance import ChamferDistance
import os os.makedirs(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'build')), exist_ok=True) from .chamfer_distance import ChamferDistance
none
1
1.741661
2
test_impartial.py
georg-wolflein/impartial
0
7505
<filename>test_impartial.py from functools import partial from impartial import impartial def f(x: int, y: int, z: int = 0) -> int: return x + 2*y + z def test_simple_call_args(): assert impartial(f, 1)(2) == f(1, 2) def test_simple_call_kwargs(): assert impartial(f, y=2)(x=1) == f(1, 2) def test_s...
<filename>test_impartial.py from functools import partial from impartial import impartial def f(x: int, y: int, z: int = 0) -> int: return x + 2*y + z def test_simple_call_args(): assert impartial(f, 1)(2) == f(1, 2) def test_simple_call_kwargs(): assert impartial(f, y=2)(x=1) == f(1, 2) def test_s...
none
1
3.077515
3
manager.py
smilechaser/screeps-script-caddy
2
7506
<reponame>smilechaser/screeps-script-caddy ''' Python script for uploading/downloading scripts for use with the game Screeps. http://support.screeps.com/hc/en-us/articles/203022612-Commiting-scripts-using-direct-API-access Usage: # # general help/usage # python3 manager.py --help # # retrie...
''' Python script for uploading/downloading scripts for use with the game Screeps. http://support.screeps.com/hc/en-us/articles/203022612-Commiting-scripts-using-direct-API-access Usage: # # general help/usage # python3 manager.py --help # # retrieve all scripts from the game and store them...
en
0.758872
Python script for uploading/downloading scripts for use with the game Screeps. http://support.screeps.com/hc/en-us/articles/203022612-Commiting-scripts-using-direct-API-access Usage: # # general help/usage # python3 manager.py --help # # retrieve all scripts from the game and store them ...
2.980259
3
contact.py
Nemfeto/python_training
0
7507
<gh_stars>0 class Contact: def __init__(self, first_name, last_name, nickname, address, mobile, email): self.first_name = first_name self.last_name = last_name self.nickname = nickname self.address = address self.mobile = mobile self.email = email
class Contact: def __init__(self, first_name, last_name, nickname, address, mobile, email): self.first_name = first_name self.last_name = last_name self.nickname = nickname self.address = address self.mobile = mobile self.email = email
none
1
2.804572
3
integreat_cms/cms/views/dashboard/admin_dashboard_view.py
Integreat/cms-v2
21
7508
<filename>integreat_cms/cms/views/dashboard/admin_dashboard_view.py import logging from django.views.generic import TemplateView from ...models import Feedback from ..chat.chat_context_mixin import ChatContextMixin logger = logging.getLogger(__name__) class AdminDashboardView(TemplateView, ChatContextMixin): "...
<filename>integreat_cms/cms/views/dashboard/admin_dashboard_view.py import logging from django.views.generic import TemplateView from ...models import Feedback from ..chat.chat_context_mixin import ChatContextMixin logger = logging.getLogger(__name__) class AdminDashboardView(TemplateView, ChatContextMixin): "...
en
0.295978
View for the admin dashboard #: The template to render (see :class:`~django.views.generic.base.TemplateResponseMixin`) #: The context dict passed to the template (see :class:`~django.views.generic.base.ContextMixin`) Returns a dictionary representing the template context (see :meth:`~django.views.generic.base.C...
1.970991
2
src/tangled_up_in_unicode/tangled_up_in_unicode_14_0_0.py
bhumikapahariapuresoftware/tangled-up-in-unicode
2
7509
<filename>src/tangled_up_in_unicode/tangled_up_in_unicode_14_0_0.py from typing import Optional import bisect from tangled_up_in_unicode.u14_0_0_data.prop_list_to_property import prop_list_to_property from tangled_up_in_unicode.u14_0_0_data.blocks_to_block_start import blocks_to_block_start from tangled_up_in_unicode...
<filename>src/tangled_up_in_unicode/tangled_up_in_unicode_14_0_0.py from typing import Optional import bisect from tangled_up_in_unicode.u14_0_0_data.prop_list_to_property import prop_list_to_property from tangled_up_in_unicode.u14_0_0_data.blocks_to_block_start import blocks_to_block_start from tangled_up_in_unicode...
en
0.907021
Returns the name assigned to the character chr as a string. If no name is defined, default is returned, or, if not given, ValueError is raised. Returns the general category assigned to the character chr as string. Returns the bidirectional class assigned to the character chr as string. If no such value is defin...
1.538689
2
to_display.py
namib-project/weatherstation-image
0
7510
from PIL import Image from PIL import ImageDraw from PIL import ImageFont import sys import ST7735 # Create ST7735 LCD display class object and set pin numbers and display hardware information. disp = ST7735.ST7735( dc=24, cs=ST7735.BG_SPI_CS_BACK, rst=25, port=0, width=122, height=160, ro...
from PIL import Image from PIL import ImageDraw from PIL import ImageFont import sys import ST7735 # Create ST7735 LCD display class object and set pin numbers and display hardware information. disp = ST7735.ST7735( dc=24, cs=ST7735.BG_SPI_CS_BACK, rst=25, port=0, width=122, height=160, ro...
en
0.697224
# Create ST7735 LCD display class object and set pin numbers and display hardware information. # Initialize display. # Initialize a secondary text with the empty string # Print test-output on the display if n oargument is given # Print the argument if only one is given # If 2 arguments are given use the second as the s...
3.289944
3
Smart User Targeted Advertising/MinorPro/FINALPROJECT/Resources/testInsert.py
saransh808/Projects
0
7511
import sqlite3 conn=sqlite3.connect('Survey.db') fo=open('insertcommand.txt') str=fo.readline() while str: str="INSERT INTO data VALUES"+str conn.execute(str) #print(str) str=fo.readline() conn.commit() conn.close() fo.close()
import sqlite3 conn=sqlite3.connect('Survey.db') fo=open('insertcommand.txt') str=fo.readline() while str: str="INSERT INTO data VALUES"+str conn.execute(str) #print(str) str=fo.readline() conn.commit() conn.close() fo.close()
ru
0.318771
#print(str)
3.635465
4
cdp/headless_experimental.py
HyperionGray/python-chrome-devtools-protocol
42
7512
# DO NOT EDIT THIS FILE! # # This file is generated from the CDP specification. If you need to make # changes, edit the generator and regenerate all of the modules. # # CDP domain: HeadlessExperimental (experimental) from __future__ import annotations from cdp.util import event_class, T_JSON_DICT from dataclasses impo...
# DO NOT EDIT THIS FILE! # # This file is generated from the CDP specification. If you need to make # changes, edit the generator and regenerate all of the modules. # # CDP domain: HeadlessExperimental (experimental) from __future__ import annotations from cdp.util import event_class, T_JSON_DICT from dataclasses impo...
en
0.825816
# DO NOT EDIT THIS FILE! # # This file is generated from the CDP specification. If you need to make # changes, edit the generator and regenerate all of the modules. # # CDP domain: HeadlessExperimental (experimental) Encoding options for a screenshot. #: Image compression format (defaults to png). #: Compression qualit...
2.011031
2
tests/test_geometry.py
resurtm/wvflib
1
7513
<filename>tests/test_geometry.py import unittest from wvflib.geometry import Face class TestGeometry(unittest.TestCase): def test_constructor(self): f = Face() self.assertTrue(len(f.vertices) == 0) if __name__ == '__main__': unittest.main()
<filename>tests/test_geometry.py import unittest from wvflib.geometry import Face class TestGeometry(unittest.TestCase): def test_constructor(self): f = Face() self.assertTrue(len(f.vertices) == 0) if __name__ == '__main__': unittest.main()
none
1
2.492651
2
tests/test_core.py
d066y/detectem
0
7514
import pytest from detectem.core import Detector, Result, ResultCollection from detectem.plugin import Plugin, PluginCollection from detectem.settings import INDICATOR_TYPE, HINT_TYPE, MAIN_ENTRY, GENERIC_TYPE from detectem.plugins.helpers import meta_generator class TestDetector(): HAR_ENTRY_1 = { 'requ...
import pytest from detectem.core import Detector, Result, ResultCollection from detectem.plugin import Plugin, PluginCollection from detectem.settings import INDICATOR_TYPE, HINT_TYPE, MAIN_ENTRY, GENERIC_TYPE from detectem.plugins.helpers import meta_generator class TestDetector(): HAR_ENTRY_1 = { 'requ...
none
1
1.928826
2
twitter-clone/twitter/views.py
Mlitwin98/twitter-clone
0
7515
<filename>twitter-clone/twitter/views.py from django.dispatch.dispatcher import receiver from django.shortcuts import get_object_or_404, redirect, render from django.contrib.auth.decorators import login_required from django.http.response import HttpResponse from django.contrib.auth.models import User from django.contri...
<filename>twitter-clone/twitter/views.py from django.dispatch.dispatcher import receiver from django.shortcuts import get_object_or_404, redirect, render from django.contrib.auth.decorators import login_required from django.http.response import HttpResponse from django.contrib.auth.models import User from django.contri...
en
0.87851
# Create your views here. #Notification on post comment
2.306471
2
custom_app/custom_app/doctype/depart/test_depart.py
Amruthaohm/custom_app
0
7516
<gh_stars>0 # Copyright (c) 2022, momscode and Contributors # See license.txt # import frappe import unittest class Testdepart(unittest.TestCase): pass
# Copyright (c) 2022, momscode and Contributors # See license.txt # import frappe import unittest class Testdepart(unittest.TestCase): pass
en
0.550405
# Copyright (c) 2022, momscode and Contributors # See license.txt # import frappe
1.02374
1
stix2/__init__.py
khdesai/cti-python-stix2
0
7517
<filename>stix2/__init__.py """Python APIs for STIX 2. .. autosummary:: :toctree: api confidence datastore environment equivalence exceptions markings parsing pattern_visitor patterns properties serialization utils v20 v21 versioning workbench """ # flake8: noqa D...
<filename>stix2/__init__.py """Python APIs for STIX 2. .. autosummary:: :toctree: api confidence datastore environment equivalence exceptions markings parsing pattern_visitor patterns properties serialization utils v20 v21 versioning workbench """ # flake8: noqa D...
en
0.517711
Python APIs for STIX 2. .. autosummary:: :toctree: api confidence datastore environment equivalence exceptions markings parsing pattern_visitor patterns properties serialization utils v20 v21 versioning workbench # flake8: noqa # Default version will always be the la...
1.917326
2
0/1/1436/1436.py
chr0m3/boj-codes
3
7518
count = int(input()) title = 0 while count > 0: title += 1 if '666' in str(title): count -= 1 print(title)
count = int(input()) title = 0 while count > 0: title += 1 if '666' in str(title): count -= 1 print(title)
none
1
3.483974
3
functions/source/GreengrassLambda/idna/uts46data.py
jieatelement/quickstart-aws-industrial-machine-connectivity
40
7519
<filename>functions/source/GreengrassLambda/idna/uts46data.py # This file is automatically generated by tools/idna-data # vim: set fileencoding=utf-8 : """IDNA Mapping Table from UTS46.""" __version__ = "11.0.0" def _seg_0(): return [ (0x0, '3'), (0x1, '3'), (0x2, '3'), (0x3, '3'), ...
<filename>functions/source/GreengrassLambda/idna/uts46data.py # This file is automatically generated by tools/idna-data # vim: set fileencoding=utf-8 : """IDNA Mapping Table from UTS46.""" __version__ = "11.0.0" def _seg_0(): return [ (0x0, '3'), (0x1, '3'), (0x2, '3'), (0x3, '3'), ...
en
0.812792
# This file is automatically generated by tools/idna-data # vim: set fileencoding=utf-8 : IDNA Mapping Table from UTS46.
1.400651
1
tests/kbcr/smart/test_smart.py
alex4321/ctp
0
7520
# -*- coding: utf-8 -*- import numpy as np import torch from torch import nn from kbcr.kernels import GaussianKernel from kbcr.smart import NeuralKB import pytest @pytest.mark.light def test_smart_v1(): embedding_size = 50 rs = np.random.RandomState(0) for _ in range(32): with torch.no_grad(...
# -*- coding: utf-8 -*- import numpy as np import torch from torch import nn from kbcr.kernels import GaussianKernel from kbcr.smart import NeuralKB import pytest @pytest.mark.light def test_smart_v1(): embedding_size = 50 rs = np.random.RandomState(0) for _ in range(32): with torch.no_grad(...
en
0.673068
# -*- coding: utf-8 -*- # test_smart_v1()
1.980975
2
test.py
eseJiHeaLim/find_child
0
7521
import tkinter window=tkinter.Tk() window.title("YUN DAE HEE") window.geometry("640x400+100+100") window.resizable(True, True) image=tkinter.PhotoImage(file="opencv_frame_0.png") label=tkinter.Label(window, image=image) label.pack() window.mainloop()
import tkinter window=tkinter.Tk() window.title("YUN DAE HEE") window.geometry("640x400+100+100") window.resizable(True, True) image=tkinter.PhotoImage(file="opencv_frame_0.png") label=tkinter.Label(window, image=image) label.pack() window.mainloop()
none
1
3.150241
3
UMSLHackRestAPI/api/urls.py
trujivan/climate-impact-changes
1
7522
<reponame>trujivan/climate-impact-changes<gh_stars>1-10 from django.urls import path, include from .views import main_view, PredictionView #router = routers.DefaultRouter(trailing_slash=False) #router.register('years', YearView, basename='years') #router.register('predict', PredictionView, basename='predict') urlpat...
from django.urls import path, include from .views import main_view, PredictionView #router = routers.DefaultRouter(trailing_slash=False) #router.register('years', YearView, basename='years') #router.register('predict', PredictionView, basename='predict') urlpatterns = [ #path('api/', get_dummy_data), #path('...
en
0.214141
#router = routers.DefaultRouter(trailing_slash=False) #router.register('years', YearView, basename='years') #router.register('predict', PredictionView, basename='predict') #path('api/', get_dummy_data), #path('pollution/predict', get_prediction, name='test_predict'), #path('myform/', api_form_view, name='year_form'), #...
1.973978
2
ievv_opensource/utils/ievv_colorize.py
appressoas/ievv_opensource
0
7523
<reponame>appressoas/ievv_opensource<gh_stars>0 from django.conf import settings from termcolor import colored #: Red color constant for :func:`.ievv_colorize`. COLOR_RED = 'red' #: Blue color constant for :func:`.ievv_colorize`. COLOR_BLUE = 'blue' #: Yellow color constant for :func:`.ievv_colorize`. COLOR_YELLOW ...
from django.conf import settings from termcolor import colored #: Red color constant for :func:`.ievv_colorize`. COLOR_RED = 'red' #: Blue color constant for :func:`.ievv_colorize`. COLOR_BLUE = 'blue' #: Yellow color constant for :func:`.ievv_colorize`. COLOR_YELLOW = 'yellow' #: Grey color constant for :func:`.i...
en
0.449517
#: Red color constant for :func:`.ievv_colorize`. #: Blue color constant for :func:`.ievv_colorize`. #: Yellow color constant for :func:`.ievv_colorize`. #: Grey color constant for :func:`.ievv_colorize`. #: Green color constant for :func:`.ievv_colorize`. Colorize a string for stdout/stderr. Colors are only appli...
2.665969
3
RSICompute.py
bluefin1986/tinyspark
3
7524
<reponame>bluefin1986/tinyspark # coding: utf-8 # In[1]: import baostock as bs import pandas as pd import numpy as np import talib as ta import matplotlib.pyplot as plt import KlineService import BaoStockUtil import math import datetime from scipy import integrate from RSI import DayRSI,WeekRSI,MonthRSI,SixtyMinRS...
# coding: utf-8 # In[1]: import baostock as bs import pandas as pd import numpy as np import talib as ta import matplotlib.pyplot as plt import KlineService import BaoStockUtil import math import datetime from scipy import integrate from RSI import DayRSI,WeekRSI,MonthRSI,SixtyMinRSI from concurrent.futures import ...
zh
0.332508
# coding: utf-8 # In[1]: #算积分用的节点数 #日线超卖区域积分阈值 # In[3]: ## # 从数据库读指定日期RSI数据 # # ## # 写RSI数据库 # # # compute1 = datetime.datetime.now().timestamp() # compute2 = datetime.datetime.now().timestamp() # print("read stockLine:", compute2 - compute1) # 剔除日线停盘数据 # compute3 = datetime.datetime.now().tim...
2.300597
2
osnoise/conf/base.py
abousselmi/OSNoise
4
7525
<gh_stars>1-10 # Copyright 2016 Orange # # 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...
# Copyright 2016 Orange # # 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, softw...
en
0.853211
# Copyright 2016 Orange # # 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, softw...
1.696526
2
src/orionsensor/gui/sensors/proximitysensor.py
Ginkooo/ORION-sensor-visualizer
0
7526
<filename>src/orionsensor/gui/sensors/proximitysensor.py from kivy.properties import NumericProperty from gui.sensors.sensor import Sensor import config class ProximitySensor(Sensor): """Proximity sensor view""" # maximum possible reading max = NumericProperty(config.ProximitySensor.max) # minimum p...
<filename>src/orionsensor/gui/sensors/proximitysensor.py from kivy.properties import NumericProperty from gui.sensors.sensor import Sensor import config class ProximitySensor(Sensor): """Proximity sensor view""" # maximum possible reading max = NumericProperty(config.ProximitySensor.max) # minimum p...
en
0.713309
Proximity sensor view # maximum possible reading # minimum possible reading
2.190569
2
Cogs/HelpCommand.py
gudtldn/DiscordStockBot
1
7527
<reponame>gudtldn/DiscordStockBot #도움말 import discord from discord.ext import commands from discord.ext.commands import Context from define import * class HelpCommand_Context(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command(name="도움말", aliases=["명령어", "?"]) @Comma...
#도움말 import discord from discord.ext import commands from discord.ext.commands import Context from define import * class HelpCommand_Context(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command(name="도움말", aliases=["명령어", "?"]) @CommandExecutionTime async def _Hel...
none
1
2.481777
2
test/test_model/cprofile_test.py
SupermeLC/PyNeval
12
7528
<filename>test/test_model/cprofile_test.py import cProfile import pstats import os # 性能分析装饰器定义 def do_cprofile(filename): """ Decorator for function profiling. """ def wrapper(func): def profiled_func(*args, **kwargs): # Flag for do profiling or not. DO_PROF = False ...
<filename>test/test_model/cprofile_test.py import cProfile import pstats import os # 性能分析装饰器定义 def do_cprofile(filename): """ Decorator for function profiling. """ def wrapper(func): def profiled_func(*args, **kwargs): # Flag for do profiling or not. DO_PROF = False ...
en
0.710747
# 性能分析装饰器定义 Decorator for function profiling. # Flag for do profiling or not. # Sort stat by internal time.
2.565689
3
renku/core/commands/providers/api.py
cyberhck/renku-python
0
7529
<filename>renku/core/commands/providers/api.py<gh_stars>0 # Copyright 2019 - Swiss Data Science Center (SDSC) # A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and # Eidgenössische Technische Hochschule Zürich (ETHZ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may no...
<filename>renku/core/commands/providers/api.py<gh_stars>0 # Copyright 2019 - Swiss Data Science Center (SDSC) # A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and # Eidgenössische Technische Hochschule Zürich (ETHZ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may no...
en
0.790732
# Copyright 2019 - Swiss Data Science Center (SDSC) # A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and # Eidgenössische Technische Hochschule Zürich (ETHZ). # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # Y...
1.978974
2
cattr/__init__.py
bluetech/cattrs
1
7530
<filename>cattr/__init__.py # -*- coding: utf-8 -*- from .converters import Converter, UnstructureStrategy __all__ = ('global_converter', 'unstructure', 'structure', 'structure_attrs_fromtuple', 'structure_attrs_fromdict', 'UnstructureStrategy') __author__ = '<NAME>' __email__ = '<EMAIL>' glob...
<filename>cattr/__init__.py # -*- coding: utf-8 -*- from .converters import Converter, UnstructureStrategy __all__ = ('global_converter', 'unstructure', 'structure', 'structure_attrs_fromtuple', 'structure_attrs_fromdict', 'UnstructureStrategy') __author__ = '<NAME>' __email__ = '<EMAIL>' glob...
en
0.769321
# -*- coding: utf-8 -*-
1.920058
2
vega/security/run_dask.py
zjzh/vega
0
7531
# -*- coding: utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. 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/LICENS...
# -*- coding: utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. 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/LICENS...
en
0.835108
# -*- coding: utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. 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.02716
2
MISSGANvsStarGAN/core/solver.py
NoaBrazilay/DeepLearningProject
2
7532
""" StarGAN v2 Copyright (c) 2020-present NAVER Corp. This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, US...
""" StarGAN v2 Copyright (c) 2020-present NAVER Corp. This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, US...
en
0.617109
StarGAN v2 Copyright (c) 2020-present NAVER Corp. This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. #...
1.868991
2
1. Algorithmic Toolbox/week2_algorithmic_warmup/4_lcm.py
vishweshwartyagi/Data-Structures-and-Algorithms-UCSD
0
7533
<reponame>vishweshwartyagi/Data-Structures-and-Algorithms-UCSD<filename>1. Algorithmic Toolbox/week2_algorithmic_warmup/4_lcm.py # Uses python3 import sys def lcm_naive(a, b): for l in range(1, a*b + 1): if l % a == 0 and l % b == 0: return l return a*b def gcd(a, b): if a%b == 0: ...
Algorithmic Toolbox/week2_algorithmic_warmup/4_lcm.py # Uses python3 import sys def lcm_naive(a, b): for l in range(1, a*b + 1): if l % a == 0 and l % b == 0: return l return a*b def gcd(a, b): if a%b == 0: return b elif b%a == 0: return a if a > b: ...
en
0.199824
# Uses python3 # input = sys.stdin.read() # print(lcm_naive(a, b))
3.598127
4
guessing_game.py
JoviCastillo/TH-Project-1-guessing-game-
0
7534
import random highscore = [] def not_in_range(guess_it): """This is to check that the numbers inputted by the user are in range, and will let the user know. If the numbers are in range then it passes. """ if guess_it < 1: print('I am not thinking of negative numbers!') elif guess_it > 10:...
import random highscore = [] def not_in_range(guess_it): """This is to check that the numbers inputted by the user are in range, and will let the user know. If the numbers are in range then it passes. """ if guess_it < 1: print('I am not thinking of negative numbers!') elif guess_it > 10:...
en
0.973428
This is to check that the numbers inputted by the user are in range, and will let the user know. If the numbers are in range then it passes. After the user has guessed the number correctly, the game will ask the player if they would like to play again. Yes will start the game again. No will exit the game. H...
4.248314
4
MAIL_SERVER.py
dastacy/gve_devnet_unity_unread_voicemail_notifier
0
7535
<reponame>dastacy/gve_devnet_unity_unread_voicemail_notifier #!/usr/bin/env python3 USER = r'server\user' PASSWORD = '<PASSWORD>' HOSTNAME = 'hostname.goes.here.com' DOMAIN = 'domain.goes.here.com' FROM_ADDR = '<EMAIL>'
#!/usr/bin/env python3 USER = r'server\user' PASSWORD = '<PASSWORD>' HOSTNAME = 'hostname.goes.here.com' DOMAIN = 'domain.goes.here.com' FROM_ADDR = '<EMAIL>'
fr
0.221828
#!/usr/bin/env python3
1.182449
1
src/testrsscast/rss/ytconverter_example.py
anetczuk/rsscast
0
7536
#!/usr/bin/python3 # # MIT License # # Copyright (c) 2021 <NAME> <<EMAIL>> # # 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 ...
#!/usr/bin/python3 # # MIT License # # Copyright (c) 2021 <NAME> <<EMAIL>> # # 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.780447
#!/usr/bin/python3 # # MIT License # # Copyright (c) 2021 <NAME> <<EMAIL>> # # 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.997403
2
cli.py
palazzem/elmo-server
0
7537
<gh_stars>0 import click APP_YAML_TEMPLATE = """runtime: python37 env_variables: ELMO_BASE_URL: '{BASE_URL}' ELMO_VENDOR: '{VENDOR}' handlers: - url: /.* script: auto secure: always redirect_http_response_code: 301 """ @click.command() @click.argument("base_url") @click.argument("vendor") def generate_app...
import click APP_YAML_TEMPLATE = """runtime: python37 env_variables: ELMO_BASE_URL: '{BASE_URL}' ELMO_VENDOR: '{VENDOR}' handlers: - url: /.* script: auto secure: always redirect_http_response_code: 301 """ @click.command() @click.argument("base_url") @click.argument("vendor") def generate_app_yaml(base_u...
en
0.536975
runtime: python37 env_variables: ELMO_BASE_URL: '{BASE_URL}' ELMO_VENDOR: '{VENDOR}' handlers: - url: /.* script: auto secure: always redirect_http_response_code: 301 Use APP_YAML_TEMPLATE to generate app.yaml for AppEngine deployments. Args: base_url: defines ELMO_BASE_URL env variable in AppEng...
3.029544
3
utils/data/dataset_catalog.py
rs9899/Parsing-R-CNN
289
7538
<gh_stars>100-1000 import os.path as osp # Root directory of project ROOT_DIR = osp.abspath(osp.join(osp.dirname(__file__), '..', '..')) # Path to data dir _DATA_DIR = osp.abspath(osp.join(ROOT_DIR, 'data')) # Required dataset entry keys _IM_DIR = 'image_directory' _ANN_FN = 'annotation_file' # Available datasets C...
import os.path as osp # Root directory of project ROOT_DIR = osp.abspath(osp.join(osp.dirname(__file__), '..', '..')) # Path to data dir _DATA_DIR = osp.abspath(osp.join(ROOT_DIR, 'data')) # Required dataset entry keys _IM_DIR = 'image_directory' _ANN_FN = 'annotation_file' # Available datasets COMMON_DATASETS = { ...
en
0.97697
# Root directory of project # Path to data dir # Required dataset entry keys # Available datasets # new addition by wzh # new addition by wzh # new addition by wzh # new addition by wzh # new addition by wzh # new addition by wzh # new addition by wzh # new addition by wzh # new addition by soeaver # new addition by so...
1.99173
2
prepareDataSet.py
Dakewe-DS1000/LapRSNet
6
7539
# Prepare my dataset for Digital Pathology import os import math import cv2 import pdb rootFolder = "F:\DataBase\LymphnodePathology" trainFolder = rootFolder + "\\trainDataSet" testFolder = rootFolder + "\\testDataSet" srcTrainFilePath = trainFolder + "\\20X\\" dstTrainFilePath = trainFolder + "\\5X\\" srcTestFileP...
# Prepare my dataset for Digital Pathology import os import math import cv2 import pdb rootFolder = "F:\DataBase\LymphnodePathology" trainFolder = rootFolder + "\\trainDataSet" testFolder = rootFolder + "\\testDataSet" srcTrainFilePath = trainFolder + "\\20X\\" dstTrainFilePath = trainFolder + "\\5X\\" srcTestFileP...
en
0.596148
# Prepare my dataset for Digital Pathology
2.150905
2
sample_project/sample_content/serializers.py
zentrumnawi/solid-backend
1
7540
<gh_stars>1-10 from rest_framework import serializers from solid_backend.photograph.serializers import PhotographSerializer from solid_backend.media_object.serializers import MediaObjectSerializer from .models import SampleProfile class SampleProfileSerializer(serializers.ModelSerializer): media_objects = MediaO...
from rest_framework import serializers from solid_backend.photograph.serializers import PhotographSerializer from solid_backend.media_object.serializers import MediaObjectSerializer from .models import SampleProfile class SampleProfileSerializer(serializers.ModelSerializer): media_objects = MediaObjectSerializer...
none
1
1.748312
2
tests/reshape_4/generate_pb.py
wchsieh/utensor_cgen
0
7541
# -*- coding: utf8 -*- import os from utensor_cgen.utils import save_consts, save_graph, save_idx import numpy as np import tensorflow as tf def generate(): test_dir = os.path.dirname(__file__) graph = tf.Graph() with graph.as_default(): x = tf.constant(np.random.randn(10), dtype=tf.floa...
# -*- coding: utf8 -*- import os from utensor_cgen.utils import save_consts, save_graph, save_idx import numpy as np import tensorflow as tf def generate(): test_dir = os.path.dirname(__file__) graph = tf.Graph() with graph.as_default(): x = tf.constant(np.random.randn(10), dtype=tf.floa...
en
0.922751
# -*- coding: utf8 -*- # test_reshape_4.pb is the same as test_quant_reshape_4.pb # hack, since we do not have QuantizedReshape yet
2.217694
2
junn-predict/junn_predict/common/logging.py
modsim/junn
0
7542
"""Logging helpers.""" import logging import sys import colorlog import tqdm class TqdmLoggingHandler(logging.StreamHandler): """TqdmLoggingHandler, outputs log messages to the console compatible with tqdm.""" def emit(self, record): # noqa: D102 message = self.format(record) tqdm.tqdm.writ...
"""Logging helpers.""" import logging import sys import colorlog import tqdm class TqdmLoggingHandler(logging.StreamHandler): """TqdmLoggingHandler, outputs log messages to the console compatible with tqdm.""" def emit(self, record): # noqa: D102 message = self.format(record) tqdm.tqdm.writ...
en
0.574987
Logging helpers. TqdmLoggingHandler, outputs log messages to the console compatible with tqdm. # noqa: D102 DelayedFileLog will cache messages till it can write them to a specified file. # noqa: D107 # noqa: D102 Set the filename to write the log messages to. :param file_name: File name to use. :param ...
2.629661
3
subpartcode/ultrasonic_basic_code.py
LesterYHZ/Automated-Bridge-Inspection-Robot-Project
1
7543
#Basic Ultrasonic sensor (HC-SR04) code import RPi.GPIO as GPIO #GPIO RPI library import time # makes sure Pi waits between steps GPIO.setmode(GPIO.BCM) #sets GPIO pin numbering #GPIO.setmode(GPIO.BOARD) #Remove warnings GPIO.setwarnings(False) #Create loop variable #loop = 1 #BCM TRIG = 23 #output pin - triggers t...
#Basic Ultrasonic sensor (HC-SR04) code import RPi.GPIO as GPIO #GPIO RPI library import time # makes sure Pi waits between steps GPIO.setmode(GPIO.BCM) #sets GPIO pin numbering #GPIO.setmode(GPIO.BOARD) #Remove warnings GPIO.setwarnings(False) #Create loop variable #loop = 1 #BCM TRIG = 23 #output pin - triggers t...
en
0.821497
#Basic Ultrasonic sensor (HC-SR04) code #GPIO RPI library # makes sure Pi waits between steps #sets GPIO pin numbering #GPIO.setmode(GPIO.BOARD) #Remove warnings #Create loop variable #loop = 1 #BCM #output pin - triggers the sensor #input pin - reads the return signal from the sensor #BOARD #TRIG=16 #ECHO=18 #Looping ...
3.420359
3
Mentorama/Modulo 3 - POO/Retangulo.py
MOURAIGOR/python
0
7544
class Retangulo: # Atributos def __init__(self, comprimento, altura): self.setcomprimento(comprimento) self.setAltura(altura) # Métodos def setcomprimento(self, comprimento): self.comprimento = comprimento def getcomprimento(self): return self.comprimento def se...
class Retangulo: # Atributos def __init__(self, comprimento, altura): self.setcomprimento(comprimento) self.setAltura(altura) # Métodos def setcomprimento(self, comprimento): self.comprimento = comprimento def getcomprimento(self): return self.comprimento def se...
pt
0.36695
# Atributos # Métodos # Executando
3.859154
4
DEMs/denmark/download_dk_dem.py
PeterFogh/digital_elevation_model_use_cases
0
7545
<filename>DEMs/denmark/download_dk_dem.py """ Fetch all files from Kortforsyningen FTP server folder. Copyright (c) 2021 <NAME> See also command line alternative in `download_dk_dem.sh` """ from ftplib import FTP, error_perm import os from pathlib import Path import time import operator import functools import shutil...
<filename>DEMs/denmark/download_dk_dem.py """ Fetch all files from Kortforsyningen FTP server folder. Copyright (c) 2021 <NAME> See also command line alternative in `download_dk_dem.sh` """ from ftplib import FTP, error_perm import os from pathlib import Path import time import operator import functools import shutil...
en
0.680394
Fetch all files from Kortforsyningen FTP server folder. Copyright (c) 2021 <NAME> See also command line alternative in `download_dk_dem.sh` # TODO: use logging to std instead of print(time.ctime()) # Functions Download FTP directory and all content to local directory. Inspired by https://stackoverflow.com/a/5512...
2.92118
3
6_refin_widgets.py
jiaxinjiang2919/Refinance-Calculator
14
7546
<gh_stars>10-100 # -*- coding: utf-8 -*- """ Created on Sun Mar 24 15:02:37 2019 @author: <NAME> """ from tkinter import * import numpy as np class LoanCalculator: def __init__(self): window = Tk() window.title("Loan Calculator") Label(window, text="Loan Amount")...
# -*- coding: utf-8 -*- """ Created on Sun Mar 24 15:02:37 2019 @author: <NAME> """ from tkinter import * import numpy as np class LoanCalculator: def __init__(self): window = Tk() window.title("Loan Calculator") Label(window, text="Loan Amount").grid(row=1, colu...
en
0.680345
# -*- coding: utf-8 -*- Created on Sun Mar 24 15:02:37 2019 @author: <NAME> # space between inputs and outputs # variables to store loan inputs # varianbles for loan outputs # text boxes to hold inputs and outputs # Refinance variables # Refinance widgets # Refi output variables
3.547802
4
ndctl.py
davelarsen58/pmemtool
3
7547
<reponame>davelarsen58/pmemtool #!/usr/bin/python3 # # PMTOOL NDCTL Python Module # Copyright (C) <NAME> # Released under MIT License import os import json from common import message, get_linenumber, pretty_print from common import V0, V1, V2, V3, V4, V5, D0, D1, D2, D3, D4, D5 import common as c import time DEFAULT...
#!/usr/bin/python3 # # PMTOOL NDCTL Python Module # Copyright (C) <NAME> # Released under MIT License import os import json from common import message, get_linenumber, pretty_print from common import V0, V1, V2, V3, V4, V5, D0, D1, D2, D3, D4, D5 import common as c import time DEFAULT_FSTAB_FILE = "/etc/fstab" DEFAU...
en
0.325317
#!/usr/bin/python3 # # PMTOOL NDCTL Python Module # Copyright (C) <NAME> # Released under MIT License # If working in a test sandbox, change paths # to start with path to sandbox # # FSTAB = SANDBOX + '/etc/fstab' # --------------------------------------------------------------------- clean up all tmp files associated ...
2.077803
2
tb/sources/__init__.py
DronMDF/manabot
1
7548
from .admin import ReviewListAdmin, SoAdminReviewIsOut, SoReviewForAdmin from .admin_commands import ( AdminCommands, AdminFilteredCommands, ReviewListByCommands, SoIgnoreReview, SoSubmitReview ) from .gerrit import ReviewOnServer, SoNewReview, SoOutReview, SoUpdateReview from .reaction import ( ReactionAlways, ...
from .admin import ReviewListAdmin, SoAdminReviewIsOut, SoReviewForAdmin from .admin_commands import ( AdminCommands, AdminFilteredCommands, ReviewListByCommands, SoIgnoreReview, SoSubmitReview ) from .gerrit import ReviewOnServer, SoNewReview, SoOutReview, SoUpdateReview from .reaction import ( ReactionAlways, ...
none
1
1.047243
1
sdk/python/pulumi_gcp/accesscontextmanager/service_perimeter.py
sisisin/pulumi-gcp
121
7549
<gh_stars>100-1000 # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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, over...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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, overload from .. import...
en
0.650665
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** The set of arguments for constructing a ServicePerimeter resource. :param pulumi.Input[str] parent: The AccessPolicy this Servic...
1.862727
2
core/swift3.1.1Action/swift3runner.py
ianpartridge/incubator-openwhisk-runtime-swift
2
7550
"""Python proxy to run Swift action. /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Ve...
"""Python proxy to run Swift action. /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Ve...
en
0.849496
Python proxy to run Swift action. /* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Versi...
2.212555
2
src/ychaos/utils/types.py
vanderh0ff/ychaos
8
7551
<filename>src/ychaos/utils/types.py from typing import Dict, List, TypeVar, Union JsonTypeVar = TypeVar("JsonTypeVar") JsonPrimitive = Union[str, float, int, bool, None] JsonDict = Dict[str, JsonTypeVar] JsonArray = List[JsonTypeVar] Json = Union[JsonPrimitive, JsonDict, JsonArray]
<filename>src/ychaos/utils/types.py from typing import Dict, List, TypeVar, Union JsonTypeVar = TypeVar("JsonTypeVar") JsonPrimitive = Union[str, float, int, bool, None] JsonDict = Dict[str, JsonTypeVar] JsonArray = List[JsonTypeVar] Json = Union[JsonPrimitive, JsonDict, JsonArray]
none
1
2.682554
3
yandex_market_language/models/promo.py
stefanitsky/yandex_market_language
7
7552
import typing as t from yandex_market_language import models from yandex_market_language.models.abstract import XMLElement, XMLSubElement class Promo(models.AbstractModel): """ Docs: https://yandex.ru/support/partnermarket/elements/promo-gift.html """ MAPPING = { "start-date": "start_date", ...
import typing as t from yandex_market_language import models from yandex_market_language.models.abstract import XMLElement, XMLSubElement class Promo(models.AbstractModel): """ Docs: https://yandex.ru/support/partnermarket/elements/promo-gift.html """ MAPPING = { "start-date": "start_date", ...
ru
0.315486
Docs: https://yandex.ru/support/partnermarket/elements/promo-gift.html # Add purchase el # Add promo gifts Docs: https://yandex.ru/support/partnermarket/elements/promo-gift.html # Add required quantity el # Add products el Docs: https://yandex.ru/support/partnermarket/elements/promo-gift.html Docs: https://yandex.r...
2.675572
3
src/testCmd.py
skogsbaer/check-assignments
0
7553
<filename>src/testCmd.py import shell from dataclasses import dataclass from utils import * from ownLogging import * from typing import * from ansi import * import re import os import testHaskell import testPython import testJava @dataclass class TestArgs: dirs: List[str] assignments: List[str] # take all if e...
<filename>src/testCmd.py import shell from dataclasses import dataclass from utils import * from ownLogging import * from typing import * from ansi import * import re import os import testHaskell import testPython import testJava @dataclass class TestArgs: dirs: List[str] assignments: List[str] # take all if e...
en
0.184606
# take all if empty
2.683551
3
kipoi_containers/singularityhelper.py
kipoi/kipoi-containers
0
7554
<gh_stars>0 from collections import Counter from datetime import datetime import os import requests from subprocess import Popen, PIPE from pathlib import Path import json from typing import Dict, Union, TYPE_CHECKING from kipoi_utils.external.torchvision.dataset_utils import download_url if TYPE_CHECKING: import...
from collections import Counter from datetime import datetime import os import requests from subprocess import Popen, PIPE from pathlib import Path import json from typing import Dict, Union, TYPE_CHECKING from kipoi_utils.external.torchvision.dataset_utils import download_url if TYPE_CHECKING: import zenodoclien...
en
0.875892
Deletes the singularity image that was created by build_singularity_image This function builds a singularity image from a dockerhub image using singularity pull. The resulting .sif is stored in <singularity_image_folder> and the filepath is returned. Tests a singularity image residing in singularity_image_folde...
2.374942
2
policy/_cache.py
garenchan/policy
5
7555
# -*- coding: utf-8 -*- """ policy._cache ~~~~~~~~~~~~~~~ Cache for policy file. """ import os import logging LOG = logging.getLogger(__name__) # Global file cache CACHE = {} def read_file(filename: str, force_reload=False): """Read a file if it has been modified. :param filename: File name ...
# -*- coding: utf-8 -*- """ policy._cache ~~~~~~~~~~~~~~~ Cache for policy file. """ import os import logging LOG = logging.getLogger(__name__) # Global file cache CACHE = {} def read_file(filename: str, force_reload=False): """Read a file if it has been modified. :param filename: File name ...
en
0.841239
# -*- coding: utf-8 -*- policy._cache ~~~~~~~~~~~~~~~ Cache for policy file. # Global file cache Read a file if it has been modified. :param filename: File name which want to be read from. :param force_reload: Whether to reload the file. :returns: A tuple with a boolean specifying if the data is f...
2.878641
3
contrib/opencensus-ext-django/opencensus/ext/django/middleware.py
samn/opencensus-python
0
7556
<filename>contrib/opencensus-ext-django/opencensus/ext/django/middleware.py # Copyright 2017, OpenCensus 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/...
<filename>contrib/opencensus-ext-django/opencensus/ext/django/middleware.py # Copyright 2017, OpenCensus 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/...
en
0.818695
# Copyright 2017, OpenCensus 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 applicable law or agreed to in w...
1.711986
2
codeblockCar/codingPage/tests.py
ICT2x01-p2-4/ICT2x01-p2-4
0
7557
from typing import Reversible from django.test import TestCase, Client from challenge.models import Challenge from codingPage.models import Command, Log from django.core.exceptions import ValidationError from django.urls import reverse class CodingPageTest(TestCase): def setUp(self) -> None: self.client = ...
from typing import Reversible from django.test import TestCase, Client from challenge.models import Challenge from codingPage.models import Command, Log from django.core.exceptions import ValidationError from django.urls import reverse class CodingPageTest(TestCase): def setUp(self) -> None: self.client = ...
en
0.569502
Test if validation works for creating new command Test if code checkers dont upload to database if log false is given
2.491186
2
app/hint/models.py
vigov5/oshougatsu2015
0
7558
<reponame>vigov5/oshougatsu2015<gh_stars>0 import os import datetime from app import app, db class Hint(db.Model): __tablename__ = 'hints' id = db.Column(db.Integer, primary_key=True) description = db.Column(db.Text) is_open = db.Column(db.Boolean) problem_id = db.Column(db.Integer, db.ForeignKey...
import os import datetime from app import app, db class Hint(db.Model): __tablename__ = 'hints' id = db.Column(db.Integer, primary_key=True) description = db.Column(db.Text) is_open = db.Column(db.Boolean) problem_id = db.Column(db.Integer, db.ForeignKey('problems.id')) def __repr__(self): ...
none
1
2.600569
3
base/urls.py
almustafa-noureddin/Portfolio-website
0
7559
from django.urls import path from . import views app_name = "base" urlpatterns = [ path('', views.IndexView.as_view(), name="home"), path('contact/', views.ContactView.as_view(), name="contact"),]
from django.urls import path from . import views app_name = "base" urlpatterns = [ path('', views.IndexView.as_view(), name="home"), path('contact/', views.ContactView.as_view(), name="contact"),]
none
1
1.754924
2
app/main/views/templates.py
cds-snc/notification-admin
16
7560
<filename>app/main/views/templates.py from datetime import datetime, timedelta from string import ascii_uppercase from dateutil.parser import parse from flask import abort, flash, jsonify, redirect, render_template, request, url_for from flask_babel import _ from flask_babel import lazy_gettext as _l from flask_login ...
<filename>app/main/views/templates.py from datetime import datetime, timedelta from string import ascii_uppercase from dateutil.parser import parse from flask import abort, flash, jsonify, redirect, render_template, request, url_for from flask_babel import _ from flask_babel import lazy_gettext as _l from flask_login ...
en
0.954352
# if we've just made a folder, we also want to move there # Add blank option to start of list
1.99336
2
linearRegression_gradientDescent/linearRegression_gradientDescent.py
MarcelloVendruscolo/DeepLearningForImageAnalysis
0
7561
<filename>linearRegression_gradientDescent/linearRegression_gradientDescent.py import numpy as np from load_auto import load_auto import matplotlib.pyplot as plt import math def initialize_parameters(observation_dimension): # observation_dimension: number of features taken into consideration of the input # ret...
<filename>linearRegression_gradientDescent/linearRegression_gradientDescent.py import numpy as np from load_auto import load_auto import matplotlib.pyplot as plt import math def initialize_parameters(observation_dimension): # observation_dimension: number of features taken into consideration of the input # ret...
en
0.591342
# observation_dimension: number of features taken into consideration of the input # returns weights as a vector and offset as a scalar # train_dataset: input data points # weights and offset_b: model parameters # returns the output predictions as a vector corresponding to each input data point # predictions: computed o...
3.478537
3
unit_tests/test_hr_calculations.py
mdholbrook/heart_rate_sentinel_server
0
7562
<filename>unit_tests/test_hr_calculations.py import pytest from functions.hr_calculations import * @pytest.mark.parametrize("candidate, database, expected", [ ('jack', [{'patient_id': 'jump'}, {'patient_id': 'jack'}], 1), ('jungle', [{'patient_id': 'jungle'}, {'patient_id': 'jack'}], 0), ('bo', [{'patient...
<filename>unit_tests/test_hr_calculations.py import pytest from functions.hr_calculations import * @pytest.mark.parametrize("candidate, database, expected", [ ('jack', [{'patient_id': 'jump'}, {'patient_id': 'jack'}], 1), ('jungle', [{'patient_id': 'jungle'}, {'patient_id': 'jack'}], 0), ('bo', [{'patient...
en
0.577346
# Run the test # Run the test # Run the test # Run the test # Generate expected result # Run the test # Run the test # Run the test # Run the test
2.828119
3
selfdrive/boardd/tests/test_boardd_api.py
919bot/Tessa
114
7563
<reponame>919bot/Tessa import random import numpy as np import selfdrive.boardd.tests.boardd_old as boardd_old import selfdrive.boardd.boardd as boardd from common.realtime import sec_since_boot from cereal import log import unittest def generate_random_can_data_list(): can_list = [] cnt = random.randint(1, 64)...
import random import numpy as np import selfdrive.boardd.tests.boardd_old as boardd_old import selfdrive.boardd.boardd as boardd from common.realtime import sec_since_boot from cereal import log import unittest def generate_random_can_data_list(): can_list = [] cnt = random.randint(1, 64) for j in range(cnt):...
en
0.440253
# Sendcan # Old API # new API # Can # new API # print('Old API, elapsed time: {} secs'.format(elapsed_old)) # print('New API, elapsed time: {} secs'.format(elapsed_new))
2.35695
2
py_types/static/parse.py
zekna/py-types
5
7564
<gh_stars>1-10 import ast import inspect import sys import argparse from ..runtime.asserts import typecheck @typecheck def pretty_print_defs(defs: list) -> None: for d in defs: print("Function definition for {}".format(d["name"])) print("Arguments:") for arg in d["args"]: arg_...
import ast import inspect import sys import argparse from ..runtime.asserts import typecheck @typecheck def pretty_print_defs(defs: list) -> None: for d in defs: print("Function definition for {}".format(d["name"])) print("Arguments:") for arg in d["args"]: arg_type = "untyped...
en
0.769892
Parses and does basic analysis of functions declared at the top level of a file. # initial pass -- get all function definitions, their names, args, and annotations # second pass -- find all expressions, double check origins of any arguments passed to any function in definitions
3.0585
3
example/example/urls.py
pmaccamp/django-tastypie-swagger
2
7565
<filename>example/example/urls.py<gh_stars>1-10 from django.conf.urls import include, url from django.contrib import admin from demo.apis import api urlpatterns = [ url(r'^api/', include(api.urls)), url(r'^api/doc/', include(('tastypie_swagger.urls', 'tastypie_swagger'), namespace...
<filename>example/example/urls.py<gh_stars>1-10 from django.conf.urls import include, url from django.contrib import admin from demo.apis import api urlpatterns = [ url(r'^api/', include(api.urls)), url(r'^api/doc/', include(('tastypie_swagger.urls', 'tastypie_swagger'), namespace...
none
1
1.779361
2
scrapy_framework/midwares/download_midware.py
savor007/scrapy_framework
0
7566
<gh_stars>0 from scrapy_framework.html.request import Request from scrapy_framework.html.response import Response import random def get_ua(): first_num=random.randint(55,69) third_num=random.randint(0,3200) forth_num=random.randint(0, 140) os_type = [ '(Windows NT 6.1; WOW64)', '(Windows NT ...
from scrapy_framework.html.request import Request from scrapy_framework.html.response import Response import random def get_ua(): first_num=random.randint(55,69) third_num=random.randint(0,3200) forth_num=random.randint(0, 140) os_type = [ '(Windows NT 6.1; WOW64)', '(Windows NT 10.0; WOW64)...
none
1
2.718433
3
tracardi/process_engine/action/v1/pro/scheduler/plugin.py
bytepl/tracardi
0
7567
from pydantic import BaseModel from tracardi.domain.entity import Entity from tracardi.domain.scheduler_config import SchedulerConfig from tracardi.domain.resource import ResourceCredentials from tracardi.service.storage.driver import storage from tracardi.service.plugin.runner import ActionRunner from tracardi.servic...
from pydantic import BaseModel from tracardi.domain.entity import Entity from tracardi.domain.scheduler_config import SchedulerConfig from tracardi.domain.resource import ResourceCredentials from tracardi.service.storage.driver import storage from tracardi.service.plugin.runner import ActionRunner from tracardi.servic...
en
0.20864
# type: SchedulerConfig
1.889135
2
tests/test_covid_daily.py
alvarobartt/covid-daily
13
7568
<filename>tests/test_covid_daily.py # Copyright 2020 <NAME>, alvarobartt @ GitHub # See LICENSE for details. import pytest import covid_daily def test_overview(): params = [ { 'as_json': True }, { 'as_json': False } ] for param in params: ...
<filename>tests/test_covid_daily.py # Copyright 2020 <NAME>, alvarobartt @ GitHub # See LICENSE for details. import pytest import covid_daily def test_overview(): params = [ { 'as_json': True }, { 'as_json': False } ] for param in params: ...
en
0.617168
# Copyright 2020 <NAME>, alvarobartt @ GitHub # See LICENSE for details.
2.337855
2
2021/HANFS/fence-agents/fence/agents/zvm/fence_zvmip.py
BryanWhitehurst/HPCCEA
10
7569
<gh_stars>1-10 #!@PYTHON@ -tt import sys import atexit import socket import struct import logging sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * from fencing import fail, fail_usage, run_delay, EC_LOGIN_DENIED, EC_TIMED_OUT #BEGIN_VERSION_GENERATION RELEASE_VERSION="" REDHAT_COPYRIGHT="" BUILD_DATE="" #...
#!@PYTHON@ -tt import sys import atexit import socket import struct import logging sys.path.append("@FENCEAGENTSLIBDIR@") from fencing import * from fencing import fail, fail_usage, run_delay, EC_LOGIN_DENIED, EC_TIMED_OUT #BEGIN_VERSION_GENERATION RELEASE_VERSION="" REDHAT_COPYRIGHT="" BUILD_DATE="" #END_VERSION_GEN...
en
0.780131
#!@PYTHON@ -tt #BEGIN_VERSION_GENERATION #END_VERSION_GENERATION # '*' = list all active images # We are running always with --missing-as-off because we can not check if image # is defined or not (look at rhbz#1188750) The fence_zvm agent is intended to be used with with z/VM SMAPI service via TCP/IP To use this agen...
2.137382
2
2.5.9/test_splash/test_splash/spiders/with_splash.py
feel-easy/myspider
1
7570
<filename>2.5.9/test_splash/test_splash/spiders/with_splash.py # -*- coding: utf-8 -*- import scrapy from scrapy_splash import SplashRequest # 使用scrapy_splash包提供的request对象 class WithSplashSpider(scrapy.Spider): name = 'with_splash' allowed_domains = ['baidu.com'] start_urls = ['https://www.baidu.com/s?wd=1...
<filename>2.5.9/test_splash/test_splash/spiders/with_splash.py # -*- coding: utf-8 -*- import scrapy from scrapy_splash import SplashRequest # 使用scrapy_splash包提供的request对象 class WithSplashSpider(scrapy.Spider): name = 'with_splash' allowed_domains = ['baidu.com'] start_urls = ['https://www.baidu.com/s?wd=1...
zh
0.852609
# -*- coding: utf-8 -*- # 使用scrapy_splash包提供的request对象 # 最大超时时间,单位:秒 # 使用splash服务的固定参数
2.710969
3
run.py
iudaichi/iu_linebot
0
7571
from main import app import os import uvicorn if __name__ == '__main__': port = int(os.getenv("PORT")) uvicorn.run(app, host="0.0.0.0", port=port, workers=1, reload=True)
from main import app import os import uvicorn if __name__ == '__main__': port = int(os.getenv("PORT")) uvicorn.run(app, host="0.0.0.0", port=port, workers=1, reload=True)
none
1
1.792976
2
fastestimator/architecture/pytorch/unet.py
DwijayDS/fastestimator
57
7572
<reponame>DwijayDS/fastestimator # Copyright 2019 The FastEstimator 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/LICENS...
# Copyright 2019 The FastEstimator 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 appl...
en
0.845853
# Copyright 2019 The FastEstimator 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 appl...
2.377219
2
generalfile/path.py
Mandera/generalfile
0
7573
<reponame>Mandera/generalfile import pathlib import os from generallibrary import VerInfo, TreeDiagram, Recycle, classproperty, deco_cache from generalfile.errors import InvalidCharacterError from generalfile.path_lock import Path_ContextManager from generalfile.path_operations import Path_Operations from generalfi...
import pathlib import os from generallibrary import VerInfo, TreeDiagram, Recycle, classproperty, deco_cache from generalfile.errors import InvalidCharacterError from generalfile.path_lock import Path_ContextManager from generalfile.path_operations import Path_Operations from generalfile.path_strings import Path_Str...
en
0.715967
Immutable cross-platform Path. Built on pathlib and TreeDiagram. Implements rules to ensure cross-platform compatability. Adds useful methods. Todo: Binary extension. #47;", ":": "&#58", ".": "&#46;"} # Don't have parent here because of Recycle # Maybe something like this to disable cert...
2.112951
2
src/genui/models/models.py
Tontolda/genui
15
7574
<gh_stars>10-100 import os from django.db import models import uuid # Create your models here. from djcelery_model.models import TaskMixin from polymorphic.models import PolymorphicModel from genui.utils.models import NON_POLYMORPHIC_CASCADE, OverwriteStorage from genui.utils.extensions.tasks.models import TaskShort...
import os from django.db import models import uuid # Create your models here. from djcelery_model.models import TaskMixin from polymorphic.models import PolymorphicModel from genui.utils.models import NON_POLYMORPHIC_CASCADE, OverwriteStorage from genui.utils.extensions.tasks.models import TaskShortcutsMixIn, Polymo...
en
0.726423
# Create your models here. # TODO: add custom logic to save in a directory specific to the project where the model is # TODO: exception when more than one main file found This will be called when a file is being saved to this model instance. You can throw the ModelFile.Rejected exception if the file ...
2.082443
2
projectroles/tests/test_views_api.py
bihealth/sodar_core
11
7575
<filename>projectroles/tests/test_views_api.py """REST API view tests for the projectroles app""" import base64 import json import pytz from django.conf import settings from django.core import mail from django.forms.models import model_to_dict from django.test import override_settings from django.urls import reverse f...
<filename>projectroles/tests/test_views_api.py """REST API view tests for the projectroles app""" import base64 import json import pytz from django.conf import settings from django.core import mail from django.forms.models import model_to_dict from django.test import override_settings from django.urls import reverse f...
en
0.806676
REST API view tests for the projectroles app # Base Classes ----------------------------------------------------------------- Mixin for SODAR and SODAR Core API views with accept headers, knox token authorization and general helper methods. # Default API header parameters are for external SODAR site APIs # Override...
1.927401
2
src/model/model.py
kwasnydam/animal_disambiguation
0
7576
<filename>src/model/model.py """Contains the classification model I am going to use in my problem and some utility functions. Functions build_mmdisambiguator - build the core application object with the collaborators info Classes MMDisambiguator - core class of the application """ import pickle import os imp...
<filename>src/model/model.py """Contains the classification model I am going to use in my problem and some utility functions. Functions build_mmdisambiguator - build the core application object with the collaborators info Classes MMDisambiguator - core class of the application """ import pickle import os imp...
en
0.701554
Contains the classification model I am going to use in my problem and some utility functions. Functions build_mmdisambiguator - build the core application object with the collaborators info Classes MMDisambiguator - core class of the application # Get directory two levels above Given collaborator parameters a...
2.684115
3
v0.5.0/nvidia/submission/code/recommendation/pytorch/load.py
myelintek/results
44
7577
# Copyright (c) 2018, deepakn94. 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 law ...
# Copyright (c) 2018, deepakn94. 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 law ...
en
0.862954
# Copyright (c) 2018, deepakn94. 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 law ...
2.892082
3
rpython/jit/backend/llsupport/test/test_rewrite.py
jptomo/pypy-lang-scheme
1
7578
from rpython.jit.backend.llsupport.descr import get_size_descr,\ get_field_descr, get_array_descr, ArrayDescr, FieldDescr,\ SizeDescr, get_interiorfield_descr from rpython.jit.backend.llsupport.gc import GcLLDescr_boehm,\ GcLLDescr_framework from rpython.jit.backend.llsupport import jitframe from rpython...
from rpython.jit.backend.llsupport.descr import get_size_descr,\ get_field_descr, get_array_descr, ArrayDescr, FieldDescr,\ SizeDescr, get_interiorfield_descr from rpython.jit.backend.llsupport.gc import GcLLDescr_boehm,\ GcLLDescr_framework from rpython.jit.backend.llsupport import jitframe from rpython...
pt
0.203914
# # # # # # # # # # # # [] p0 = new(descr=sdescr) jump() [p1] p0 = call_malloc_gc(ConstClass(malloc_fixedsize), %(sdescr.size)d,\ descr=malloc_fixedsize_descr) jump() [] p0 = new(descr=sdescr) p1 = new(descr=sdescr) ...
1.873418
2
hummingbot/client/command/history_command.py
sanchaymittal/hummingbot
0
7579
<filename>hummingbot/client/command/history_command.py from decimal import Decimal import pandas as pd from typing import ( Any, Dict, Set, Tuple, TYPE_CHECKING) from hummingbot.client.performance_analysis import PerformanceAnalysis from hummingbot.core.utils.exchange_rate_conversion import Exchang...
<filename>hummingbot/client/command/history_command.py from decimal import Decimal import pandas as pd from typing import ( Any, Dict, Set, Tuple, TYPE_CHECKING) from hummingbot.client.performance_analysis import PerformanceAnalysis from hummingbot.core.utils.exchange_rate_conversion import Exchang...
en
0.652395
# type: HummingbotApplication # type: HummingbotApplication # type: HummingbotApplication # type: HummingbotApplication # Prevent KeyError '***SYMBOL***' # Adding this check to prevent assets in the same market to be added multiple times # type: HummingbotApplication # Compute the current exchange rate. We use the firs...
2.515782
3
scripts/bin2asm.py
sami2316/asm2vec-pytorch
0
7580
<reponame>sami2316/asm2vec-pytorch import re import os import click import r2pipe import hashlib from pathlib import Path import _pickle as cPickle def sha3(data): return hashlib.sha3_256(data.encode()).hexdigest() def validEXE(filename): magics = [bytes.fromhex('7f454c46')] with open(filename, 'rb') as f...
import re import os import click import r2pipe import hashlib from pathlib import Path import _pickle as cPickle def sha3(data): return hashlib.sha3_256(data.encode()).hexdigest() def validEXE(filename): magics = [bytes.fromhex('7f454c46')] with open(filename, 'rb') as f: header = f.read(4) ...
en
0.620151
# check # set label # dump output # add label # add instruction # # Create directory where results will be written to. # Extract assembly functions from binary executable # create output directory # directory # file
2.516226
3
6/4.py
Chyroc/homework
0
7581
import re def remove_not_alpha_num(string): return re.sub('[^0-9a-zA-Z]+', '', string) if __name__ == '__main__': print(remove_not_alpha_num('a000 aa-b') == 'a000aab')
import re def remove_not_alpha_num(string): return re.sub('[^0-9a-zA-Z]+', '', string) if __name__ == '__main__': print(remove_not_alpha_num('a000 aa-b') == 'a000aab')
none
1
3.509137
4
LazyAngus/Assets/Extensions/IOSDeploy/Scripts/Editor/post_process.py
DougLazyAngus/lazyAngus
0
7582
<reponame>DougLazyAngus/lazyAngus<gh_stars>0 import os from sys import argv from mod_pbxproj import XcodeProject #import appcontroller path = argv[1] frameworks = argv[2].split(' ') libraries = argv[3].split(' ') cflags = argv[4].split(' ') ldflags = argv[5].split(' ') folders = argv[6].split(' ') pri...
import os from sys import argv from mod_pbxproj import XcodeProject #import appcontroller path = argv[1] frameworks = argv[2].split(' ') libraries = argv[3].split(' ') cflags = argv[4].split(' ') ldflags = argv[5].split(' ') folders = argv[6].split(' ') print('Step 1: add system frameworks ') #if...
en
0.351301
#import appcontroller #if framework is optional, add `weak=True`
2.122999
2
judge/migrations/0024_auto_20200705_0246.py
TheAvidDev/pnoj-site
2
7583
<gh_stars>1-10 # Generated by Django 3.0.8 on 2020-07-05 02:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('judge', '0023_auto_20200704_2318'), ] operations = [ migrations.AlterField( model_name='submission', ...
# Generated by Django 3.0.8 on 2020-07-05 02:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('judge', '0023_auto_20200704_2318'), ] operations = [ migrations.AlterField( model_name='submission', name='language'...
en
0.802684
# Generated by Django 3.0.8 on 2020-07-05 02:46
1.784503
2
src/badge_hub.py
stottlerhenke-seattle/openbadge-hub-py
0
7584
#!/usr/bin/env python from __future__ import absolute_import, division, print_function import os import re import shlex import subprocess import signal import csv import logging import json import time from datetime import datetime as dt from requests.exceptions import RequestException import glob import traceback i...
#!/usr/bin/env python from __future__ import absolute_import, division, print_function import os import re import shlex import subprocess import signal import csv import logging import json import time from datetime import datetime as dt from requests.exceptions import RequestException import glob import traceback i...
en
0.824497
#!/usr/bin/env python # seconds #NOTE try to keep under 100MB or so due to memory constraints # in bytes, so 15MB # create logger with 'badge_server' # create file handler which logs even debug messages # create console handler with a higher log level # create formatter and add it to the handlers # formatter = logging....
1.74356
2
python/compile.py
liamgam/gdkit
1
7585
import compileall compileall.compile_dir(".",force=1)
import compileall compileall.compile_dir(".",force=1)
none
1
1.174575
1
saleor/product/migrations/0141_update_descritpion_fields.py
fairhopeweb/saleor
15,337
7586
# Generated by Django 3.1.5 on 2021-02-17 11:04 from django.db import migrations import saleor.core.db.fields import saleor.core.utils.editorjs def update_empty_description_field(apps, schema_editor): Category = apps.get_model("product", "Category") CategoryTranslation = apps.get_model("product", "CategoryT...
# Generated by Django 3.1.5 on 2021-02-17 11:04 from django.db import migrations import saleor.core.db.fields import saleor.core.utils.editorjs def update_empty_description_field(apps, schema_editor): Category = apps.get_model("product", "Category") CategoryTranslation = apps.get_model("product", "CategoryT...
en
0.813567
# Generated by Django 3.1.5 on 2021-02-17 11:04
1.668498
2
local_search/sat_isfayer.py
arnaubena97/SatSolver-sat_isfayer
0
7587
#!/usr/bin/env python3 import sys import random def read_file(file_name): """File reader and parser the num of variables, num of clauses and put the clauses in a list""" clauses =[] with open(file_name) as all_file: for line in all_file: if line.startswith('c'): continue #ignore comment...
#!/usr/bin/env python3 import sys import random def read_file(file_name): """File reader and parser the num of variables, num of clauses and put the clauses in a list""" clauses =[] with open(file_name) as all_file: for line in all_file: if line.startswith('c'): continue #ignore comment...
en
0.839743
#!/usr/bin/env python3 File reader and parser the num of variables, num of clauses and put the clauses in a list #ignore comments # set num_variables Method to print the solution that satisfies all the clauses Constructor of the solver Create a random solution of cnf formula. Ex: [-1, 2, 3, -4, ...] Return a list with ...
3.849441
4
torch/_VF.py
Hacky-DH/pytorch
60,067
7588
""" This makes the functions in torch._C._VariableFunctions available as torch._VF.<funcname> without mypy being able to find them. A subset of those functions are mapped to ATen functions in torch/jit/_builtins.py See https://github.com/pytorch/pytorch/issues/21478 for the reason for introducing torch._VF """ i...
""" This makes the functions in torch._C._VariableFunctions available as torch._VF.<funcname> without mypy being able to find them. A subset of those functions are mapped to ATen functions in torch/jit/_builtins.py See https://github.com/pytorch/pytorch/issues/21478 for the reason for introducing torch._VF """ i...
en
0.866004
This makes the functions in torch._C._VariableFunctions available as torch._VF.<funcname> without mypy being able to find them. A subset of those functions are mapped to ATen functions in torch/jit/_builtins.py See https://github.com/pytorch/pytorch/issues/21478 for the reason for introducing torch._VF
2.507393
3
sparse_causal_model_learner_rl/annealer/threshold_projection.py
sergeivolodin/causality-disentanglement-rl
2
7589
<filename>sparse_causal_model_learner_rl/annealer/threshold_projection.py import gin import torch import logging from sparse_causal_model_learner_rl.metrics import find_value, find_key @gin.configurable def ProjectionThreshold(config, config_object, epoch_info, temp, adjust_every=100, metric_threshold=0...
<filename>sparse_causal_model_learner_rl/annealer/threshold_projection.py import gin import torch import logging from sparse_causal_model_learner_rl.metrics import find_value, find_key @gin.configurable def ProjectionThreshold(config, config_object, epoch_info, temp, adjust_every=100, metric_threshold=0...
none
1
1.980903
2
numpyro/contrib/control_flow/scan.py
ucals/numpyro
2
7590
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 from collections import OrderedDict from functools import partial from jax import lax, random, tree_flatten, tree_map, tree_multimap, tree_unflatten import jax.numpy as jnp from jax.tree_util import register_pytree_node_class from nu...
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 from collections import OrderedDict from functools import partial from jax import lax, random, tree_flatten, tree_map, tree_multimap, tree_unflatten import jax.numpy as jnp from jax.tree_util import register_pytree_node_class from nu...
en
0.773069
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 # scanned sites have stop field because we trace them inside a block handler # this branch happens when substitute_fn is init_strategy, # where we apply init_strategy to each element in the scanned series # this branch happens when we s...
1.980766
2
src/catalog/migrations/0003_remove_productattributevalue_name.py
earth-emoji/dennea
0
7591
<filename>src/catalog/migrations/0003_remove_productattributevalue_name.py # Generated by Django 2.2.12 on 2020-06-10 01:11 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('catalog', '0002_auto_20200610_0019'), ] operations = [ migrations.Remove...
<filename>src/catalog/migrations/0003_remove_productattributevalue_name.py # Generated by Django 2.2.12 on 2020-06-10 01:11 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('catalog', '0002_auto_20200610_0019'), ] operations = [ migrations.Remove...
en
0.737844
# Generated by Django 2.2.12 on 2020-06-10 01:11
1.529524
2
e2xgrader/preprocessors/overwritecells.py
divindevaiah/e2xgrader
2
7592
import json from nbformat.notebooknode import NotebookNode from nbconvert.exporters.exporter import ResourcesDict from typing import Tuple from nbgrader.api import MissingEntry from nbgrader.preprocessors import OverwriteCells as NbgraderOverwriteCells from ..utils.extra_cells import is_singlechoice, is_multiplechoi...
import json from nbformat.notebooknode import NotebookNode from nbconvert.exporters.exporter import ResourcesDict from typing import Tuple from nbgrader.api import MissingEntry from nbgrader.preprocessors import OverwriteCells as NbgraderOverwriteCells from ..utils.extra_cells import is_singlechoice, is_multiplechoi...
none
1
2.132648
2
tools/pdf2txt.py
ehtec/pdfminer.six
0
7593
<reponame>ehtec/pdfminer.six #!/usr/bin/env python3 """A command line tool for extracting text and images from PDF and output it to plain text, html, xml or tags.""" import argparse import logging import sys from typing import Any, Container, Iterable, List, Optional import pdfminer.high_level from pdfminer.layout imp...
#!/usr/bin/env python3 """A command line tool for extracting text and images from PDF and output it to plain text, html, xml or tags.""" import argparse import logging import sys from typing import Any, Container, Iterable, List, Optional import pdfminer.high_level from pdfminer.layout import LAParams from pdfminer.ut...
en
0.42331
#!/usr/bin/env python3 A command line tool for extracting text and images from PDF and output it to plain text, html, xml or tags. # will be used for defaults # Propagate parsed layout parameters to LAParams object
3.088829
3
nython/nythonize.py
agungnasik57/nython
53
7594
"""Compile Nim libraries as Python Extension Modules. If you want your namespace to coexist with your pthon code, name this ponim.nim and then your import will look like `from ponim.nim import adder` and `from ponim import subtractor`. There must be a way to smooth that out in the __init__.py file somehow. Note that ...
"""Compile Nim libraries as Python Extension Modules. If you want your namespace to coexist with your pthon code, name this ponim.nim and then your import will look like `from ponim.nim import adder` and `from ponim import subtractor`. There must be a way to smooth that out in the __init__.py file somehow. Note that ...
en
0.842822
Compile Nim libraries as Python Extension Modules. If you want your namespace to coexist with your pthon code, name this ponim.nim and then your import will look like `from ponim.nim import adder` and `from ponim import subtractor`. There must be a way to smooth that out in the __init__.py file somehow. Note that the...
2.387884
2
tests/contrib/test_util.py
lixinso/pyro
10
7595
<filename>tests/contrib/test_util.py from collections import OrderedDict import pytest import torch import pyro.distributions as dist from pyro.contrib.util import ( get_indices, tensor_to_dict, rmv, rvv, lexpand, rexpand, rdiag, rtril, hessian ) from tests.common import assert_equal def test_get_indices_sizes()...
<filename>tests/contrib/test_util.py from collections import OrderedDict import pytest import torch import pyro.distributions as dist from pyro.contrib.util import ( get_indices, tensor_to_dict, rmv, rvv, lexpand, rexpand, rdiag, rtril, hessian ) from tests.common import assert_equal def test_get_indices_sizes()...
none
1
2.106208
2
emodul/apps.py
HarisHijazi/mojarnik-server
0
7596
from django.apps import AppConfig class EmodulConfig(AppConfig): name = 'emodul'
from django.apps import AppConfig class EmodulConfig(AppConfig): name = 'emodul'
none
1
1.059093
1
Diffnet++/class/DataModule.py
mIXs222/diffnet
0
7597
from __future__ import division from collections import defaultdict import numpy as np from time import time import random import tensorflow.compat.v1 as tf tf.disable_v2_behavior() # import tensorflow as tf class DataModule(): def __init__(self, conf, filename): self.conf = conf self.data_dict = ...
from __future__ import division from collections import defaultdict import numpy as np from time import time import random import tensorflow.compat.v1 as tf tf.disable_v2_behavior() # import tensorflow as tf class DataModule(): def __init__(self, conf, filename): self.conf = conf self.data_dict = ...
en
0.485936
# import tensorflow as tf ####### Initalize Procedures ####### #self.arrangePositiveData() ####### Data Loading ####### # ---------------------- # This function designes for generating train/val/test negative # ---------------------- # This function designes for val/test set, compute loss # ---------------------- # T...
2.365766
2
src/models/VanillaTransformer.py
iosurodri/annotated-transformer
0
7598
from xmlrpc.server import MultiPathXMLRPCServer import torch.nn as nn import torch.nn.functional as F import copy from src.layers.layers import Encoder, EncoderLayer, Decoder, DecoderLayer, PositionwiseFeedForward from src.layers.preprocessing import Embeddings, PositionalEncoding from src.layers.attention import Mult...
from xmlrpc.server import MultiPathXMLRPCServer import torch.nn as nn import torch.nn.functional as F import copy from src.layers.layers import Encoder, EncoderLayer, Decoder, DecoderLayer, PositionwiseFeedForward from src.layers.preprocessing import Embeddings, PositionalEncoding from src.layers.attention import Mult...
en
0.862204
### Generic EncoderDecoder structure: A standard Encoder-Decoder architecture. Base for this and many other models. # This was important from their code. # Initialize parameters with Glorot / fan_avg. # Small example model
2.243912
2
venv/lib/python3.8/site-packages/arch/tests/univariate/test_recursions.py
YileC928/finm-portfolio-2021
0
7599
import os import timeit from typing import List import numpy as np from numpy.random import RandomState from numpy.testing import assert_allclose, assert_almost_equal import pytest from scipy.special import gamma import arch.univariate.recursions_python as recpy CYTHON_COVERAGE = os.environ.get("ARCH_CYTHON_COVERAGE...
import os import timeit from typing import List import numpy as np from numpy.random import RandomState from numpy.testing import assert_allclose, assert_almost_equal import pytest from scipy.special import gamma import arch.univariate.recursions_python as recpy CYTHON_COVERAGE = os.environ.get("ARCH_CYTHON_COVERAGE...
en
0.335827
# noqa import numpy as np import arch.univariate.recursions as rec import arch.univariate.recursions_python as recpy nobs = 10000 resids = np.random.standard_normal(nobs) sigma2 = np.zeros_like(resids) var = resids.var() backcast = 1.0 var_bounds = np.array([var / 1000000.0, var * 1000000.0]) var_bounds = np.ones((nob...
2.242768
2