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
ui_mant_libros.py
edzzn/Manejo_Liberia
0
3100
from PyQt4 import QtGui from ui_mant_libros_new import NewLibrosWindow from ui_mant_libros_edit import EditLibrosWindow from ui_mant_libros_id_edit import GetIdEditWindow # Debug only import inspect class MenuLibros(QtGui.QWidget): """ Ventana-menu para editar Libros """ def __init__(self): ...
from PyQt4 import QtGui from ui_mant_libros_new import NewLibrosWindow from ui_mant_libros_edit import EditLibrosWindow from ui_mant_libros_id_edit import GetIdEditWindow # Debug only import inspect class MenuLibros(QtGui.QWidget): """ Ventana-menu para editar Libros """ def __init__(self): ...
en
0.144374
# Debug only Ventana-menu para editar Libros # self.new_reserva_view = NewReserva() # self.new_reserva_view.show() # self.new_reserva_view = NewReserva() # self.new_reserva_view.show()
2.267545
2
env/gym_poker_ai/envs/tests/holdem_calc/holdem_argparser.py
MrStonkus/PokerAi
0
3101
<reponame>MrStonkus/PokerAi<gh_stars>0 import argparse import re import holdem_calc.holdem_functions as holdem_functions # Wrapper class which holds the arguments for library calls # Mocks actual argparse object class LibArgs: def __init__(self, board, exact, num, input_file, hole_cards): self.board = boa...
import argparse import re import holdem_calc.holdem_functions as holdem_functions # Wrapper class which holds the arguments for library calls # Mocks actual argparse object class LibArgs: def __init__(self, board, exact, num, input_file, hole_cards): self.board = board self.cards = hole_cards ...
en
0.775778
# Wrapper class which holds the arguments for library calls # Mocks actual argparse object # Parses arguments passed to holdem_calc as a library call # Parse hole cards and board # Parses command line arguments to holdem_calc # Define possible command line arguments # Parse command line arguments and check for errors #...
3.380837
3
qbay/controllers.py
KarlDorogy/Cisc-327-Course-Project-Group-20
0
3102
from flask import render_template, request, session, redirect from qbay.models import * from datetime import date from qbay import app def authenticate(inner_function): """ :param inner_function: any python function that accepts a user object Wrap any python function and check the current session to see ...
from flask import render_template, request, session, redirect from qbay.models import * from datetime import date from qbay import app def authenticate(inner_function): """ :param inner_function: any python function that accepts a user object Wrap any python function and check the current session to see ...
en
0.813613
:param inner_function: any python function that accepts a user object Wrap any python function and check the current session to see if the user has logged in. If login, it will call the inner_function with the logged in user object. To wrap a function, we can put a decoration on that function. Examp...
3.478588
3
gbfs/serializers.py
stadtulm/cykel
80
3103
<gh_stars>10-100 from datetime import timedelta from django.utils.timezone import now from preferences import preferences from rest_framework import fields, serializers from bikesharing.models import Bike, Station, VehicleType from cykel.serializers import EnumFieldSerializer class TimestampSerializer(fields.CharFi...
from datetime import timedelta from django.utils.timezone import now from preferences import preferences from rest_framework import fields, serializers from bikesharing.models import Bike, Station, VehicleType from cykel.serializers import EnumFieldSerializer class TimestampSerializer(fields.CharField): def to_...
en
0.929758
# defined by GBFS 2.1: Only if the vehicle has a motor the field is required # Default to False TODO: maybe configuration later # Default to False TODO: maybe configuration later # only return bikes with public geolocation # if configured filter vehicles, where time report # is older than configure allowed silent timep...
2.136253
2
anime_downloader/extractors/vidstream.py
ngomile/anime-downloader
2
3104
import logging import re from anime_downloader.extractors.base_extractor import BaseExtractor from anime_downloader.sites import helpers logger = logging.getLogger(__name__) class VidStream(BaseExtractor): def _get_data(self): QUALITIES = { "360":[], "480":[], "720":[], "10...
import logging import re from anime_downloader.extractors.base_extractor import BaseExtractor from anime_downloader.sites import helpers logger = logging.getLogger(__name__) class VidStream(BaseExtractor): def _get_data(self): QUALITIES = { "360":[], "480":[], "720":[], "10...
en
0.970671
#In case nothing is found
2.720377
3
gui/sum_v1/views.py
time-crunched/nlp-toolbox
0
3105
<filename>gui/sum_v1/views.py import time import os from django.shortcuts import render, redirect from django.http import JsonResponse from django.views import View from django.conf import settings from .forms import File_uploadForm from .models import File_upload, SummaryRes from sim_v1.textsummary import TEXTSumm...
<filename>gui/sum_v1/views.py import time import os from django.shortcuts import render, redirect from django.http import JsonResponse from django.views import View from django.conf import settings from .forms import File_uploadForm from .models import File_upload, SummaryRes from sim_v1.textsummary import TEXTSumm...
en
0.72407
#summary_document_dir = r'C:\Users\ERDIG\Dropbox\Python\nlp_v1\media\sum_v1\upload' #summary_extraction_dir = r'C:\Users\ERDIG\Dropbox\Python\nlp_v1\media\sum_v1\temp' # You don't need this line. This is just to delay the process so you can see the progress bar testing locally.
2.16009
2
homeassistant/components/websocket_api/__init__.py
dannyqwertz/home-assistant
4
3106
<reponame>dannyqwertz/home-assistant """ Websocket based API for Home Assistant. For more details about this component, please refer to the documentation at https://developers.home-assistant.io/docs/external_api_websocket.html """ from homeassistant.core import callback from homeassistant.loader import bind_hass from...
""" Websocket based API for Home Assistant. For more details about this component, please refer to the documentation at https://developers.home-assistant.io/docs/external_api_websocket.html """ from homeassistant.core import callback from homeassistant.loader import bind_hass from . import commands, connection, const...
en
0.626138
Websocket based API for Home Assistant. For more details about this component, please refer to the documentation at https://developers.home-assistant.io/docs/external_api_websocket.html # Backwards compat / Make it easier to integrate # pylint: disable=invalid-name # pylint: enable=invalid-name Register a websocket co...
2.289435
2
test_app/settings.py
Lenders-Cooperative/Django-DocuSign
0
3107
<reponame>Lenders-Cooperative/Django-DocuSign<filename>test_app/settings.py # # Created on Tue Dec 21 2021 # # Copyright (c) 2021 Lenders Cooperative, a division of Summit Technology Group, Inc. # """ Django settings for test_app project. Generated by 'django-admin startproject' using Django 3.1.7. For more informati...
# # Created on Tue Dec 21 2021 # # Copyright (c) 2021 Lenders Cooperative, a division of Summit Technology Group, Inc. # """ Django settings for test_app project. Generated by 'django-admin startproject' using Django 3.1.7. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ ...
en
0.695483
# # Created on Tue Dec 21 2021 # # Copyright (c) 2021 Lenders Cooperative, a division of Summit Technology Group, Inc. # Django settings for test_app project. Generated by 'django-admin startproject' using Django 3.1.7. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For...
1.702781
2
tests/unit/ppr/test_search_query.py
doug-lovett/test-schemas-dl
0
3108
# Copyright © 2020 Province of British Columbia # # 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 agr...
# Copyright © 2020 Province of British Columbia # # 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 agr...
en
0.913337
# Copyright © 2020 Province of British Columbia # # 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 agr...
2.019663
2
devopsipy/decorators.py
kharnam/devopsipy
0
3109
""" Module to contain Pywork decorators """ __author__ = '<NAME>' import re import time import itertools import logging log = logging.getLogger(__name__)
""" Module to contain Pywork decorators """ __author__ = '<NAME>' import re import time import itertools import logging log = logging.getLogger(__name__)
en
0.590822
Module to contain Pywork decorators
2.360084
2
tests/test_decorators.py
stephenfin/django-rest-framework
1
3110
from __future__ import unicode_literals import pytest from django.test import TestCase from rest_framework import status from rest_framework.authentication import BasicAuthentication from rest_framework.decorators import ( action, api_view, authentication_classes, detail_route, list_route, parser_classes, per...
from __future__ import unicode_literals import pytest from django.test import TestCase from rest_framework import status from rest_framework.authentication import BasicAuthentication from rest_framework.decorators import ( action, api_view, authentication_classes, detail_route, list_route, parser_classes, per...
en
0.770688
If @api_view is not applied correct, we should raise an assertion. If @api_view is missing arguments, we should raise an assertion. Checks CustomSchema class is set on view Description # All HTTP methods should be mappable # Python 2.x compatibility - cast __name__ to str # ensure the mapping returns the correct method...
2.184866
2
tamilmorse/morse_encode.py
CRE2525/open-tamil
1
3111
<reponame>CRE2525/open-tamil<filename>tamilmorse/morse_encode.py ## -*- coding: utf-8 -*- #(C) 2018 <NAME> # This file is part of Open-Tamil project # You may use or distribute this file under terms of MIT license import codecs import json import tamil import sys import os #e.g. python morse_encode.py கலைஞர் CURRDIR ...
## -*- coding: utf-8 -*- #(C) 2018 <NAME> # This file is part of Open-Tamil project # You may use or distribute this file under terms of MIT license import codecs import json import tamil import sys import os #e.g. python morse_encode.py கலைஞர் CURRDIR = os.path.dirname(os.path.realpath(__file__)) def encode(text): ...
en
0.543621
## -*- coding: utf-8 -*- #(C) 2018 <NAME> # This file is part of Open-Tamil project # You may use or distribute this file under terms of MIT license #e.g. python morse_encode.py கலைஞர்
2.980252
3
Leetcode/Python/_1721.py
Xrenya/algorithms
0
3112
<filename>Leetcode/Python/_1721.py<gh_stars>0 # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def swapNodes(self, head: Optional[ListNode], k: int) -> Optional[ListNode]: temp = head ...
<filename>Leetcode/Python/_1721.py<gh_stars>0 # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def swapNodes(self, head: Optional[ListNode], k: int) -> Optional[ListNode]: temp = head ...
en
0.627719
# Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next
3.754276
4
contrib/functional_tests/functional/test_reorg.py
electrumsv/electrumsv
136
3113
<reponame>electrumsv/electrumsv<filename>contrib/functional_tests/functional/test_reorg.py """ Warning - this will reset all components back to a blank state before running the simulation Runs node1, electrumx1 and electrumsv1 and loads the default wallet on the daemon (so that newly submitted blocks will be synchroni...
""" Warning - this will reset all components back to a blank state before running the simulation Runs node1, electrumx1 and electrumsv1 and loads the default wallet on the daemon (so that newly submitted blocks will be synchronized by ElectrumSV reorged txid: 'a1fa9460ca105c1396cd338f7fa202bf79a9d244d730e91e19f6302a0...
en
0.6438
Warning - this will reset all components back to a blank state before running the simulation Runs node1, electrumx1 and electrumsv1 and loads the default wallet on the daemon (so that newly submitted blocks will be synchronized by ElectrumSV reorged txid: 'a1fa9460ca105c1396cd338f7fa202bf79a9d244d730e91e19f6302a05b2f...
2.103732
2
Pyrado/pyrado/environments/mujoco/wam_bic.py
KhanhThiVo/SimuRLacra
0
3114
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and # Technical University of Darmstadt. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code mus...
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and # Technical University of Darmstadt. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code mus...
en
0.793031
# Copyright (c) 2020, <NAME>, Honda Research Institute Europe GmbH, and # Technical University of Darmstadt. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code mus...
1.097004
1
pyRasp.py
ToninoTarsi/pyRasp
0
3115
# pyRasp # Copyright (c) <NAME> 2020. Licensed under MIT. # requirement : # Python 3 # pip install pyyaml # pip install request # pip install f90nml from downloadGFSA import downloadGFSA from prepare_wps import prepare_wps from ungrib import ungrib from metgrid import metgrid from prepare_wrf import prepare_wrf fro...
# pyRasp # Copyright (c) <NAME> 2020. Licensed under MIT. # requirement : # Python 3 # pip install pyyaml # pip install request # pip install f90nml from downloadGFSA import downloadGFSA from prepare_wps import prepare_wps from ungrib import ungrib from metgrid import metgrid from prepare_wrf import prepare_wrf fro...
en
0.462204
# pyRasp # Copyright (c) <NAME> 2020. Licensed under MIT. # requirement : # Python 3 # pip install pyyaml # pip install request # pip install f90nml
1.610083
2
app/strategies/ema_bb_alligator_strategy.py
namuan/crypto-rider
1
3116
import pandas as pd import ta from app.common import reshape_data from app.strategies.base_strategy import BaseStrategy pd.set_option("display.max_columns", None) pd.set_option("display.width", None) class EMABBAlligatorStrategy(BaseStrategy): BUY_SIGNAL = "buy_signal" SELL_SIGNAL = "sell_signal" def c...
import pandas as pd import ta from app.common import reshape_data from app.strategies.base_strategy import BaseStrategy pd.set_option("display.max_columns", None) pd.set_option("display.width", None) class EMABBAlligatorStrategy(BaseStrategy): BUY_SIGNAL = "buy_signal" SELL_SIGNAL = "sell_signal" def c...
none
1
2.463539
2
BasicScripts/basics.py
TomasBelskis/PythonAutomation
0
3117
# Python Basics # String concatenaton added_strings = str(32) + "_342" # Getting input input_from_user = input() # Basic print function print(input_from_user) # Mixing boolean and comparison operations if (4 < 5) and (5 < 6): print("True") # Basic if & if else flow if name == 'Alice': print('Hi, Alice.')...
# Python Basics # String concatenaton added_strings = str(32) + "_342" # Getting input input_from_user = input() # Basic print function print(input_from_user) # Mixing boolean and comparison operations if (4 < 5) and (5 < 6): print("True") # Basic if & if else flow if name == 'Alice': print('Hi, Alice.')...
en
0.485597
# Python Basics # String concatenaton # Getting input # Basic print function # Mixing boolean and comparison operations # Basic if & if else flow # Loops in Python 3 # Access loop # For loops using range function # Using starting range # Importing modules # Exiting a python program
3.996054
4
env.example.py
wilcoln/klazor
8
3118
<filename>env.example.py DATABASE_OPTIONS = { 'database': 'klazor', 'user': 'root', 'password': '', 'charset': 'utf8mb4', } HOSTS = ['127.0.0.1', '172.16.58.3']
<filename>env.example.py DATABASE_OPTIONS = { 'database': 'klazor', 'user': 'root', 'password': '', 'charset': 'utf8mb4', } HOSTS = ['127.0.0.1', '172.16.58.3']
none
1
1.337984
1
misc/_local_settings.py
lzantal/djskell
4
3119
<gh_stars>1-10 """ Django settings. Generated by 'django-admin startproject' using Django 2.2.4. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ #DEBUG = False DE...
""" Django settings. Generated by 'django-admin startproject' using Django 2.2.4. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ #DEBUG = False DEBUG = True SERV...
en
0.513173
Django settings. Generated by 'django-admin startproject' using Django 2.2.4. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ #DEBUG = False # Database # https://docs....
1.422035
1
contacts/forms.py
pedrohd21/Agenda-Django
1
3120
<gh_stars>1-10 from django import forms from .models import Contact class ContactForm(forms.ModelForm): class Meta: model = Contact fields = ('name', 'number', 'email', 'category', 'description')
from django import forms from .models import Contact class ContactForm(forms.ModelForm): class Meta: model = Contact fields = ('name', 'number', 'email', 'category', 'description')
none
1
2.186271
2
awx/api/urls/ad_hoc_command.py
ziegenberg/awx
0
3121
<reponame>ziegenberg/awx<filename>awx/api/urls/ad_hoc_command.py # Copyright (c) 2017 Ansible, Inc. # All Rights Reserved. from django.urls import re_path from awx.api.views import ( AdHocCommandList, AdHocCommandDetail, AdHocCommandCancel, AdHocCommandRelaunch, AdHocCommandAdHocCommandEventsList,...
# Copyright (c) 2017 Ansible, Inc. # All Rights Reserved. from django.urls import re_path from awx.api.views import ( AdHocCommandList, AdHocCommandDetail, AdHocCommandCancel, AdHocCommandRelaunch, AdHocCommandAdHocCommandEventsList, AdHocCommandActivityStreamList, AdHocCommandNotification...
en
0.751687
# Copyright (c) 2017 Ansible, Inc. # All Rights Reserved.
1.793763
2
note5/package_test5.py
icexmoon/python-learning-notes
0
3122
#test.py from time_tools import * # print(compareTimestamp(111,222)) time.showNowTime() # now time is XX:XX:XX
#test.py from time_tools import * # print(compareTimestamp(111,222)) time.showNowTime() # now time is XX:XX:XX
en
0.673133
#test.py # print(compareTimestamp(111,222)) # now time is XX:XX:XX
2.495068
2
fgarcade/sprites.py
fabiommendes/fgarcade
2
3123
<gh_stars>1-10 import arcade from arcade import FACE_RIGHT, FACE_DOWN, FACE_UP, FACE_LEFT class AnimatedWalkingSprite(arcade.Sprite): def __init__(self, scale: float = 1, image_x: float = 0, image_y: float = 0, center_x: float = 0, center_y: float = 0, *, stand_l...
import arcade from arcade import FACE_RIGHT, FACE_DOWN, FACE_UP, FACE_LEFT class AnimatedWalkingSprite(arcade.Sprite): def __init__(self, scale: float = 1, image_x: float = 0, image_y: float = 0, center_x: float = 0, center_y: float = 0, *, stand_left, stand_righ...
en
0.282502
# Falling # Jumping # Going left # Going right
2.623222
3
src/mafUtility.py
gh-schen/SiriusEpiClassifier
1
3124
<filename>src/mafUtility.py<gh_stars>1-10 from numpy.core.fromnumeric import transpose from sklearn import linear_model from scipy.special import logit from scipy import stats from copy import deepcopy from numpy import random, concatenate, quantile, matmul, transpose import logging class singleRegModel(): """ ...
<filename>src/mafUtility.py<gh_stars>1-10 from numpy.core.fromnumeric import transpose from sklearn import linear_model from scipy.special import logit from scipy import stats from copy import deepcopy from numpy import random, concatenate, quantile, matmul, transpose import logging class singleRegModel(): """ ...
en
0.630421
data struct for running a single regression test # params #preds = matmul(input_x, transpose(self.mmodel.coef_)) + self.mmodel.intercept_ #print(preds, self.mmodel.predict(input_x)) #probs = preds[:,0] #return probs store output for prediction # with CV training can have multiple results # binary: 0 for normal and 1 fo...
2.51186
3
examples/linreg.py
hanyas/sds
12
3125
import numpy as np import matplotlib.pyplot as plt from scipy import stats from sklearn.linear_model import ARDRegression, LinearRegression # Parameters of the example np.random.seed(0) n_samples, n_features = 100, 100 # Create Gaussian data X = np.random.randn(n_samples, n_features) # Create weights with a precision...
import numpy as np import matplotlib.pyplot as plt from scipy import stats from sklearn.linear_model import ARDRegression, LinearRegression # Parameters of the example np.random.seed(0) n_samples, n_features = 100, 100 # Create Gaussian data X = np.random.randn(n_samples, n_features) # Create weights with a precision...
en
0.254589
# Parameters of the example # Create Gaussian data # Create weights with a precision lambda_ of 4. # Only keep 10 weights of interest # Create noise with a precision alpha of 50. # Create the target< # parameter posterior # likelihood precision posterior # parameter precision posterior # plt.plot(ols.coef_, color='yell...
2.867097
3
optimal/tompkins/examples/dask_scheduling_problem_nonetcontention.py
KarizCache/serverless
0
3126
#!/usr/bin/python3 import os import json import re import ast import json from graphviz import Digraph import pandas as pd # color the graph import graph_tool.all as gt import copy import matplotlib.colors as mcolors import sys import utils from tompkins.ilp import schedule, jobs_when_where from collections import d...
#!/usr/bin/python3 import os import json import re import ast import json from graphviz import Digraph import pandas as pd # color the graph import graph_tool.all as gt import copy import matplotlib.colors as mcolors import sys import utils from tompkins.ilp import schedule, jobs_when_where from collections import d...
en
0.451823
#!/usr/bin/python3 # color the graph # color the graph #, scheduler = bnch.rsplit(':', 1) # 1 second # 1GB #ts.replace("(", '').replace(')', '').split("'")[1].split('-')[0] #ts += ')' #if benchmark['scheduler'] == "vanilla": # dg.node(f'{v}') #else: #if benchmark['scheduler'] == "vanilla": # dg.edge(f'{e.source(...
2.106222
2
tests/apitests/python/test_robot_account.py
gerhardgossen/harbor
1
3127
from __future__ import absolute_import import unittest from testutils import ADMIN_CLIENT from testutils import TEARDOWN from library.user import User from library.project import Project from library.repository import Repository from library.repository import pull_harbor_image from library.repository import push_imag...
from __future__ import absolute_import import unittest from testutils import ADMIN_CLIENT from testutils import TEARDOWN from library.user import User from library.project import Project from library.repository import Repository from library.repository import pull_harbor_image from library.repository import push_imag...
en
0.814814
#1. Delete repository(RA) by user(UA); #2. Delete project(PA); #3. Delete user(UA). Test case: Robot Account Test step and expected result: 1. Create user(UA); 2. Create private project(PA), private project(PB) and public project(PC) by user(UA); 3. Push image(ImagePA) to project(PA), image...
2.248074
2
slackchannel2pdf/locales.py
ErikKalkoken/slackchannel2pdf
52
3128
import datetime as dt import logging from babel import Locale, UnknownLocaleError from babel.dates import format_datetime, format_time, format_date import pytz from tzlocal import get_localzone from . import settings logger = logging.getLogger(__name__) class LocaleHelper: """Helpers for converting date & tim...
import datetime as dt import logging from babel import Locale, UnknownLocaleError from babel.dates import format_datetime, format_time, format_date import pytz from tzlocal import get_localzone from . import settings logger = logging.getLogger(__name__) class LocaleHelper: """Helpers for converting date & tim...
en
0.677119
Helpers for converting date & time according to current locale and timezone Args: - my_locale: Primary locale to use - my_tz: Primary timezone to use - author_info: locale and timezone to use from this Slack response if my_locale and/or my_tz are not given returns formated datetime strin...
2.70576
3
databoard/databoard/default_config.py
glemaitre/ramp-board-1
0
3129
<reponame>glemaitre/ramp-board-1<gh_stars>0 import os class Config(object): # FLASK GENERAL CONFIG PARAMETERS SECRET_KEY = os.getenv('DATABOARD_SECRET_KEY', '<KEY>') # abs max upload file size, to throw 413, before saving it WTF_CSRF_ENABLED = True LOG_FILENAME = None # if None, output to screen ...
import os class Config(object): # FLASK GENERAL CONFIG PARAMETERS SECRET_KEY = os.getenv('DATABOARD_SECRET_KEY', '<KEY>') # abs max upload file size, to throw 413, before saving it WTF_CSRF_ENABLED = True LOG_FILENAME = None # if None, output to screen MAX_CONTENT_LENGTH = 1024 * 1024 * 1024 ...
en
0.436536
# FLASK GENERAL CONFIG PARAMETERS # abs max upload file size, to throw 413, before saving it # if None, output to screen # FLASK MAIL CONFIG PARAMETERS # make it False if parallel training is not working # is_parallelize ######################################################################
2.038307
2
python_developer_tools/cv/bases/pool/AvgPool2d.py
carlsummer/python_developer_tools
32
3130
<filename>python_developer_tools/cv/bases/pool/AvgPool2d.py # !/usr/bin/env python # -- coding: utf-8 -- # @Author zengxiaohui # Datatime:8/31/2021 1:37 PM # @File:GlobalAvgPool2d import torch.nn as nn from python_developer_tools.cv.bases.activates.swish import h_swish class GlobalAvgPool2d(nn.Module): """ Fast ...
<filename>python_developer_tools/cv/bases/pool/AvgPool2d.py # !/usr/bin/env python # -- coding: utf-8 -- # @Author zengxiaohui # Datatime:8/31/2021 1:37 PM # @File:GlobalAvgPool2d import torch.nn as nn from python_developer_tools.cv.bases.activates.swish import h_swish class GlobalAvgPool2d(nn.Module): """ Fast ...
en
0.575091
# !/usr/bin/env python # -- coding: utf-8 -- # @Author zengxiaohui # Datatime:8/31/2021 1:37 PM # @File:GlobalAvgPool2d Fast implementation of global average pooling from TResNet: High Performance GPU-Dedicated Architecture https://arxiv.org/pdf/2003.13630.pdf Args: flatten (bool, optional):...
2.442319
2
expyfun/_utils.py
nordme/expyfun
2
3131
<filename>expyfun/_utils.py """Some utility functions""" # Authors: <NAME> <<EMAIL>> # # License: BSD (3-clause) import warnings import operator from copy import deepcopy import subprocess import importlib import os import os.path as op import inspect import sys import tempfile import ssl from shutil import rmtree im...
<filename>expyfun/_utils.py """Some utility functions""" # Authors: <NAME> <<EMAIL>> # # License: BSD (3-clause) import warnings import operator from copy import deepcopy import subprocess import importlib import os import os.path as op import inspect import sys import tempfile import ssl from shutil import rmtree im...
en
0.692673
Some utility functions # Authors: <NAME> <<EMAIL>> # # License: BSD (3-clause) # set this first thing to make sure it "takes" # for py3k (eventually) # noqa # noqa, input is raw_input in py3k # noqa # noqa # noqa # noqa, analysis:ignore # noqa, analysis:ignore ###########################################################...
2.016814
2
mixin.py
delimatorres/foodbasket
0
3132
import signal class KillableProcess(object): def __init__(self): self.interrupt = False signal.signal(signal.SIGTERM, self._signal_handler) signal.signal(signal.SIGINT, self._signal_handler) def _signal_handler(self, sign, frame): self.interrupt = True
import signal class KillableProcess(object): def __init__(self): self.interrupt = False signal.signal(signal.SIGTERM, self._signal_handler) signal.signal(signal.SIGINT, self._signal_handler) def _signal_handler(self, sign, frame): self.interrupt = True
none
1
2.328143
2
test5.py
liubaishuo-github/peening-post-processor
0
3133
def HAHA(): return 1,2,3 a = HAHA() print(a) print(a[0])
def HAHA(): return 1,2,3 a = HAHA() print(a) print(a[0])
none
1
2.729873
3
torch/_fx/graph_module.py
jsun94/nimble
206
3134
<gh_stars>100-1000 import torch import torch.overrides import linecache from typing import Type, Dict, List, Any, Union from .graph import Graph import copy # normal exec loses the source code, however we can patch # the linecache module to still recover it. # using exec_with_source will add it to our local cache # an...
import torch import torch.overrides import linecache from typing import Type, Dict, List, Any, Union from .graph import Graph import copy # normal exec loses the source code, however we can patch # the linecache module to still recover it. # using exec_with_source will add it to our local cache # and then tools like T...
en
0.811912
# normal exec loses the source code, however we can patch # the linecache module to still recover it. # using exec_with_source will add it to our local cache # and then tools like TorchScript will be able to get source info. # patch linecache so that any code we exec using exec_with_source # works with inspect Deserial...
2.43605
2
RequestHandler.py
robot0nfire/behem0th
2
3135
# # Copyright (c) 2016 <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 use, copy, modify, merge, publish, ...
# # Copyright (c) 2016 <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 use, copy, modify, merge, publish, ...
en
0.845719
# # Copyright (c) 2016 <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 use, copy, modify, merge, publish, ...
1.970348
2
tests/utils/test_metrics.py
haochuanwei/hover
251
3136
<filename>tests/utils/test_metrics.py<gh_stars>100-1000 from hover.utils.metrics import classification_accuracy import numpy as np def test_classification_accuracy(): true = np.array([1, 2, 3, 4, 5, 6, 7, 7]) pred = np.array([1, 2, 3, 4, 5, 6, 7, 8]) accl = classification_accuracy(true, pred) accr = cl...
<filename>tests/utils/test_metrics.py<gh_stars>100-1000 from hover.utils.metrics import classification_accuracy import numpy as np def test_classification_accuracy(): true = np.array([1, 2, 3, 4, 5, 6, 7, 7]) pred = np.array([1, 2, 3, 4, 5, 6, 7, 8]) accl = classification_accuracy(true, pred) accr = cl...
none
1
1.974223
2
scripts/blenderseed.package.py
rgirish28/blenderseed
0
3137
<filename>scripts/blenderseed.package.py #!/usr/bin/python # # This source file is part of appleseed. # Visit https://appleseedhq.net/ for additional information and resources. # # This software is released under the MIT license. # # Copyright (c) 2017-2018 <NAME>, The appleseedhq Organization # # Permission is hereby...
<filename>scripts/blenderseed.package.py #!/usr/bin/python # # This source file is part of appleseed. # Visit https://appleseedhq.net/ for additional information and resources. # # This software is released under the MIT license. # # Copyright (c) 2017-2018 <NAME>, The appleseedhq Organization # # Permission is hereby...
en
0.568639
#!/usr/bin/python # # This source file is part of appleseed. # Visit https://appleseedhq.net/ for additional information and resources. # # This software is released under the MIT license. # # Copyright (c) 2017-2018 <NAME>, The appleseedhq Organization # # Permission is hereby granted, free of charge, to any person ob...
1.172237
1
uts/uts_17_aut_py/2/A.py
viad00/code_olymp
0
3138
<filename>uts/uts_17_aut_py/2/A.py ser = int(input()) mas = list(map(int, input().split())) mas.sort() print(*mas)
<filename>uts/uts_17_aut_py/2/A.py ser = int(input()) mas = list(map(int, input().split())) mas.sort() print(*mas)
none
1
2.318598
2
wagtailkatex/wagtail_hooks.py
ongchi/wagtail-katex
0
3139
from django.utils.translation import gettext from wagtail.admin.rich_text.editors.draftail import features as draftail_features from wagtail.core import hooks from .richtext import KaTeXEntityElementHandler, katex_entity_decorator @hooks.register('register_rich_text_features') def register_katex_features(features):...
from django.utils.translation import gettext from wagtail.admin.rich_text.editors.draftail import features as draftail_features from wagtail.core import hooks from .richtext import KaTeXEntityElementHandler, katex_entity_decorator @hooks.register('register_rich_text_features') def register_katex_features(features):...
en
0.716601
Registering the `katex` feature, which uses the `KATEX` Draft.js entity type, and is stored as HTML with a `<div data-katex-embed="c = \\pm\\sqrt{a^2 + b^2}">` tag.
1.971668
2
esque_wire/protocol/serializers/api/elect_preferred_leaders_request.py
real-digital/esque-wire
0
3140
############################################################### # Autogenerated module. Please don't modify. # # Edit according file in protocol_generator/templates instead # ############################################################### from typing import Dict from ...structs.api.elect_preferred_le...
############################################################### # Autogenerated module. Please don't modify. # # Edit according file in protocol_generator/templates instead # ############################################################### from typing import Dict from ...structs.api.elect_preferred_le...
de
0.58148
############################################################### # Autogenerated module. Please don't modify. # # Edit according file in protocol_generator/templates instead # ###############################################################
1.598757
2
test/tests/bootstrap/test_api20_windows_bootstrap.py
arunrordell/RackHD
451
3141
''' Copyright 2017 Dell Inc. or its subsidiaries. All Rights Reserved. This script tests arbitrary payload of the RackHD API 2.0 OS bootstrap workflows. The default case is running a minimum payload Windows OS install. Other Windows-type OS install cases can be specified by creating a payload file and specifiying it u...
''' Copyright 2017 Dell Inc. or its subsidiaries. All Rights Reserved. This script tests arbitrary payload of the RackHD API 2.0 OS bootstrap workflows. The default case is running a minimum payload Windows OS install. Other Windows-type OS install cases can be specified by creating a payload file and specifiying it u...
en
0.688503
Copyright 2017 Dell Inc. or its subsidiaries. All Rights Reserved. This script tests arbitrary payload of the RackHD API 2.0 OS bootstrap workflows. The default case is running a minimum payload Windows OS install. Other Windows-type OS install cases can be specified by creating a payload file and specifiying it using...
2.195953
2
random_number.py
till-h/alexa
0
3142
from flask import Flask, render_template from flask_ask import Ask, statement import random app = Flask(__name__) ask = Ask(app, '/') @ask.intent('RandomNumber', convert={'lowerLimit': int, 'upperLimit': int}) def hello(lowerLimit, upperLimit): if lowerLimit == None: lowerLimit = 0 if upperLimit == None: upperL...
from flask import Flask, render_template from flask_ask import Ask, statement import random app = Flask(__name__) ask = Ask(app, '/') @ask.intent('RandomNumber', convert={'lowerLimit': int, 'upperLimit': int}) def hello(lowerLimit, upperLimit): if lowerLimit == None: lowerLimit = 0 if upperLimit == None: upperL...
none
1
2.888788
3
model/losses.py
askerlee/rift
11
3143
<reponame>askerlee/rift import torch import numpy as np import torch.nn as nn import torch.nn.functional as F import torchvision.models as models from model.laplacian import LapLoss device = torch.device("cuda" if torch.cuda.is_available() else "cpu") class EPE(nn.Module): def __init__(self): super(EPE, ...
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F import torchvision.models as models from model.laplacian import LapLoss device = torch.device("cuda" if torch.cuda.is_available() else "cpu") class EPE(nn.Module): def __init__(self): super(EPE, self).__init__() de...
en
0.925743
# flow could have any channels. # https://github.com/coolbeam/OIFlow/blob/main/utils/tools.py # dx2, dxdy = gradient(dx) # dydx, dy2 = gradient(dy) # smooth_loss = dx.abs().mean() + dy.abs().mean() # + dx2.abs().mean() + dxdy.abs().mean() + dydx.abs().mean() + dy2.abs().mean() # 暂时不上二阶的平滑损失,似乎加上以后就太猛了,无法降低photo loss T...
2.443347
2
project/python/swarm_simulation.py
righetti/swarmrobotics
8
3144
import numpy as np import pybullet as p import itertools from robot import Robot class World(): def __init__(self): # create the physics simulator self.physicsClient = p.connect(p.GUI) p.setGravity(0,0,-9.81) self.max_communication_distance = 2.0 # We will int...
import numpy as np import pybullet as p import itertools from robot import Robot class World(): def __init__(self): # create the physics simulator self.physicsClient = p.connect(p.GUI) p.setGravity(0,0,-9.81) self.max_communication_distance = 2.0 # We will int...
en
0.236157
# create the physics simulator # We will integrate every 4ms (250Hz update) # Create the plane. # the balls # Add objects # tube # wallId = p.loadSDF("../models/walls.sdf")[0] # p.resetBasePositionAndOrientation(wallId, [-1., 5., 0], (0., 0., 0., 1.)) # wallId = p.loadSDF("../models/walls.sdf")[0] # p.resetBasePosition...
2.491932
2
boto/ec2/elb/__init__.py
wt/boto
15
3145
<gh_stars>10-100 # Copyright (c) 2006-2012 <NAME> http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # 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 S...
# Copyright (c) 2006-2012 <NAME> http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # 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 r...
en
0.741952
# Copyright (c) 2006-2012 <NAME> http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All Rights Reserved # # 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 r...
1.767866
2
basis_set_exchange/cli/bse_cli.py
atomse/basis_set_exchange
0
3146
<reponame>atomse/basis_set_exchange ''' Command line interface for the basis set exchange ''' import argparse import argcomplete from .. import version from .bse_handlers import bse_cli_handle_subcmd from .check import cli_check_normalize_args from .complete import (cli_case_insensitive_validator, ...
''' Command line interface for the basis set exchange ''' import argparse import argcomplete from .. import version from .bse_handlers import bse_cli_handle_subcmd from .check import cli_check_normalize_args from .complete import (cli_case_insensitive_validator, cli_family_completer, cli_role_co...
de
0.395208
Command line interface for the basis set exchange ################################################################################################ # NOTE: I am deliberately not using the 'choices' argument in add_argument. I could use it # for formats, etc, however I wouldn't want to use it for basis set names. Therefo...
2.418988
2
Backjoon/1929.py
hanjungwoo1/CodingTest
3
3147
""" 입력 예시 3 16 출력 예시 3 5 7 11 13 """ import math left, right = map(int, input().split()) array = [True for i in range(right+1)] array[1] = 0 for i in range(2, int(math.sqrt(right)) + 1): if array[i] == True: j = 2 while i * j <= right: array[i * j] = False j += 1 for i in...
""" 입력 예시 3 16 출력 예시 3 5 7 11 13 """ import math left, right = map(int, input().split()) array = [True for i in range(right+1)] array[1] = 0 for i in range(2, int(math.sqrt(right)) + 1): if array[i] == True: j = 2 while i * j <= right: array[i * j] = False j += 1 for i in...
ko
0.999792
입력 예시 3 16 출력 예시 3 5 7 11 13
3.388087
3
tensorflow/tools/quantization/quantize_graph_test.py
tianyapiaozi/tensorflow
374
3148
# Copyright 2015 The TensorFlow 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 applica...
# Copyright 2015 The TensorFlow 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 applica...
en
0.81847
# Copyright 2015 The TensorFlow 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 applica...
2.069062
2
layerserver/migrations/0001_initial.py
aroiginfraplan/giscube-admin
5
3149
# -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-04-26 09:14 import colorfield.fields from django.db import migrations, models import django.db.models.deletion import giscube.utils class Migration(migrations.Migration): initial = True dependencies = [ ('giscube', '0002_update'), ]...
# -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-04-26 09:14 import colorfield.fields from django.db import migrations, models import django.db.models.deletion import giscube.utils class Migration(migrations.Migration): initial = True dependencies = [ ('giscube', '0002_update'), ]...
en
0.704581
# -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-04-26 09:14
1.729755
2
SETTINGS.py
pirica/fortnite-leaks-image-generator
5
3150
<filename>SETTINGS.py backgroundurl = "https://storage.needpix.com/rsynced_images/colored-background.jpg" # <- Need to be a Image URL!!! lang = "en" # <- language code displayset = True # <- Display the Set of the Item raritytext = True # <- Display the Rarity of the Item typeconfig = { "BannerToken": True,...
<filename>SETTINGS.py backgroundurl = "https://storage.needpix.com/rsynced_images/colored-background.jpg" # <- Need to be a Image URL!!! lang = "en" # <- language code displayset = True # <- Display the Set of the Item raritytext = True # <- Display the Rarity of the Item typeconfig = { "BannerToken": True,...
en
0.67073
# <- Need to be a Image URL!!! # <- language code # <- Display the Set of the Item # <- Display the Rarity of the Item # <- Time (in seconds) until the bot checks for leaks again | Recommend: 7 # <- Leave it empty if you dont want one # <- Size of the Watermark
2.192609
2
src/healthvaultlib/tests/testbase.py
rajeevs1992/pyhealthvault
1
3151
<filename>src/healthvaultlib/tests/testbase.py import unittest import settings from healthvaultlib.helpers.connection import Connection class TestBase(unittest.TestCase): def setUp(self): self.connection = self.get_connection() def get_connection(self): conn = Connection(settings.HV_...
<filename>src/healthvaultlib/tests/testbase.py import unittest import settings from healthvaultlib.helpers.connection import Connection class TestBase(unittest.TestCase): def setUp(self): self.connection = self.get_connection() def get_connection(self): conn = Connection(settings.HV_...
none
1
2.225043
2
apps/extensions/migrations/0012_imports_path_urlfield_to_charfield.py
StepicOrg/stepik-apps
5
3152
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-06-09 03:01 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('extensions', '0011_auto_20170502_0908'), ] operations = [ migrations.AlterF...
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-06-09 03:01 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('extensions', '0011_auto_20170502_0908'), ] operations = [ migrations.AlterF...
en
0.759446
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-06-09 03:01
1.399031
1
regtests/bench/thread_collision.py
secureosv/pythia
17
3153
''' multi-threading (python3 version) https://docs.python.org/3/library/threading.html ''' from time import clock import threading THREADS=2 lock = threading.Lock() A = 0 B = 0 C = 0 def test_globals(): global A, B, C for i in range(1024*1024): lock.acquire() A += 1 B += 2 C = A + B lock.release() def...
''' multi-threading (python3 version) https://docs.python.org/3/library/threading.html ''' from time import clock import threading THREADS=2 lock = threading.Lock() A = 0 B = 0 C = 0 def test_globals(): global A, B, C for i in range(1024*1024): lock.acquire() A += 1 B += 2 C = A + B lock.release() def...
en
0.702893
multi-threading (python3 version) https://docs.python.org/3/library/threading.html
3.764949
4
game/board.py
scooler/checkers
0
3154
import numpy as np class Board: """ 0 - black 1 - white """ def __init__(self): board = [ [0, 1] * 4, [1, 0] * 4 ] * 4 players_board = [ [0, 1] * 4, # player 1 [1, 0] * 4 ] + [[0] * 8] * 4 + [ # 4 rows of nothing [0, 2] * 4, # player 2 [2, 0] * 4 ] se...
import numpy as np class Board: """ 0 - black 1 - white """ def __init__(self): board = [ [0, 1] * 4, [1, 0] * 4 ] * 4 players_board = [ [0, 1] * 4, # player 1 [1, 0] * 4 ] + [[0] * 8] * 4 + [ # 4 rows of nothing [0, 2] * 4, # player 2 [2, 0] * 4 ] se...
en
0.364916
0 - black 1 - white # player 1 # 4 rows of nothing # player 2 # def move(self, x, y, current_player): # self.board[x, y] = current_player # def are_same_and_non_zero(self, array): # return np.unique(array).size == 1 and array[0] != 0 # def is_board_full(self): # return not np.any(np.unique(self.board) == 0) is ...
3.539185
4
utils/get_season_things_price.py
vogelfenx/storagebot
0
3155
def get_season_things_price(thing, amount, price): if thing == 'wheel': wheel_price = price[thing]['month'] * amount return f'Стоимость составит {wheel_price}/месяц' else: other_thing_price_week = price[thing]['week'] * amount other_thing_price_month = price[thing]['month'] * a...
def get_season_things_price(thing, amount, price): if thing == 'wheel': wheel_price = price[thing]['month'] * amount return f'Стоимость составит {wheel_price}/месяц' else: other_thing_price_week = price[thing]['week'] * amount other_thing_price_month = price[thing]['month'] * a...
none
1
3.451113
3
zge/engine.py
zhester/zge
0
3156
<reponame>zhester/zge """ Zoe Game Engine Core Implementation =================================== Requirements ------------ [pygame](http://www.pygame.org/) """ # core packages # third-party packages import pygame # local package import layer __version__ = '0.0.0' #=============================================...
""" Zoe Game Engine Core Implementation =================================== Requirements ------------ [pygame](http://www.pygame.org/) """ # core packages # third-party packages import pygame # local package import layer __version__ = '0.0.0' #===================================================================...
en
0.551547
Zoe Game Engine Core Implementation =================================== Requirements ------------ [pygame](http://www.pygame.org/) # core packages # third-party packages # local package #============================================================================= Simple game engine object. #=========================...
3.124983
3
Authentication/migrations/0004_auto_20201115_1105.py
CHESyrian/Estebyan
0
3157
<filename>Authentication/migrations/0004_auto_20201115_1105.py # Generated by Django 3.0.6 on 2020-11-15 09:05 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('Authentication', '0003_auto_20201113_2210'), ] operations = [ migrations.Alte...
<filename>Authentication/migrations/0004_auto_20201115_1105.py # Generated by Django 3.0.6 on 2020-11-15 09:05 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('Authentication', '0003_auto_20201113_2210'), ] operations = [ migrations.Alte...
en
0.818473
# Generated by Django 3.0.6 on 2020-11-15 09:05
1.347544
1
dashboard/urls.py
EdisonBr/MockDados
0
3158
<filename>dashboard/urls.py from django.urls import path, re_path from django.views.generic.base import TemplateView from .views import dashboard_cost, dashboard_energy, MotorDataListView app_name = 'dashboard' urlpatterns = [ path('', MotorDataListView.as_view(), name='dashboard_custom'), #path('', dash...
<filename>dashboard/urls.py from django.urls import path, re_path from django.views.generic.base import TemplateView from .views import dashboard_cost, dashboard_energy, MotorDataListView app_name = 'dashboard' urlpatterns = [ path('', MotorDataListView.as_view(), name='dashboard_custom'), #path('', dash...
it
0.237259
#path('', dashboard_custom, name='dashboard_custom'),
1.836398
2
Coursera/Python for Everybody Specialization/Python for everybody basics/hourly rate.py
ejgarcia1991/Courses-and-other-non-professional-projects
1
3159
hrs = input("Enter Hours:") rate = input("Enter rate:") pay = float(hrs) * float(rate) print("Pay: " +str(pay))
hrs = input("Enter Hours:") rate = input("Enter rate:") pay = float(hrs) * float(rate) print("Pay: " +str(pay))
none
1
3.786534
4
litex_boards/platforms/xilinx_kcu105.py
smunaut/litex-boards
177
3160
# # This file is part of LiteX-Boards. # # Copyright (c) 2017-2019 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-2-Clause from litex.build.generic_platform import * from litex.build.xilinx import XilinxPlatform, VivadoProgrammer # IOs ---------------------------------------------------------------------------------...
# # This file is part of LiteX-Boards. # # Copyright (c) 2017-2019 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-2-Clause from litex.build.generic_platform import * from litex.build.xilinx import XilinxPlatform, VivadoProgrammer # IOs ---------------------------------------------------------------------------------...
en
0.485944
# # This file is part of LiteX-Boards. # # Copyright (c) 2017-2019 <NAME> <<EMAIL>> # SPDX-License-Identifier: BSD-2-Clause # IOs ---------------------------------------------------------------------------------------------- # Clk / Rst # Leds # Buttons # Switches # SMA # I2C # Serial # SPIFlash # clock needs to be acc...
1.339488
1
code/advent_of_code_day3.py
erinleeryan/2020adventofcode
0
3161
<gh_stars>0 #!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import math # In[2]: fileObj = open('../data/advent_of_code_input_day_three.txt', "r") #opens the file in read mode. items = fileObj. read(). splitlines() #puts the file into an array. # In[3]: #print (items) def split(line): ...
#!/usr/bin/env python # coding: utf-8 # In[1]: import numpy as np import math # In[2]: fileObj = open('../data/advent_of_code_input_day_three.txt', "r") #opens the file in read mode. items = fileObj. read(). splitlines() #puts the file into an array. # In[3]: #print (items) def split(line): return lis...
en
0.498088
#!/usr/bin/env python # coding: utf-8 # In[1]: # In[2]: #opens the file in read mode. #puts the file into an array. # In[3]: #print (items) # In[7]: # In[ ]:
3.443969
3
input_handler.py
Wyverns010/Body-Keypoints-Detection
1
3162
import os import traceback class InputHandler: IMAGES_PARENT_FOLDER = './images' def __init__(self): filesList = [] def listFiles(self,path=''): if path != '': self.IMAGES_PARENT_FOLDER = path try: self.listFiles = [os.path.join(self.IMAGES_PAREN...
import os import traceback class InputHandler: IMAGES_PARENT_FOLDER = './images' def __init__(self): filesList = [] def listFiles(self,path=''): if path != '': self.IMAGES_PARENT_FOLDER = path try: self.listFiles = [os.path.join(self.IMAGES_PAREN...
none
1
3.0958
3
docker/autoconfig.py
misc0110/bepasty-server
0
3163
<filename>docker/autoconfig.py #!/usr/bin/python import os import sys SITENAME = os.environ.get("BEPASTY_SITENAME", None) if SITENAME is None: print("\n\nEnvironment variable BEPASTY_SITENAME must be set.") sys.exit(1) SECRET_KEY = os.environ.get("BEPASTY_SECRET_KEY", None) if SECRET_KEY is None: print("...
<filename>docker/autoconfig.py #!/usr/bin/python import os import sys SITENAME = os.environ.get("BEPASTY_SITENAME", None) if SITENAME is None: print("\n\nEnvironment variable BEPASTY_SITENAME must be set.") sys.exit(1) SECRET_KEY = os.environ.get("BEPASTY_SECRET_KEY", None) if SECRET_KEY is None: print("...
ru
0.258958
#!/usr/bin/python
2.267153
2
pysh/transforms/alpha/bangexpr.py
drslump/pysh
3
3164
<reponame>drslump/pysh from io import StringIO import re import tokenize import os from collections import deque, ChainMap from functools import lru_cache from enum import Enum import pysh from pysh.path import PathWrapper, Path from typing import List, Callable, Iterator, Tuple, NamedTuple, Deque, Union, Any TBangTr...
from io import StringIO import re import tokenize import os from collections import deque, ChainMap from functools import lru_cache from enum import Enum import pysh from pysh.path import PathWrapper, Path from typing import List, Callable, Iterator, Tuple, NamedTuple, Deque, Union, Any TBangTransformer = Callable[ [...
en
0.795197
# runtime symbols # it's intended for this to be global #.+', t('COMMENT', lambda v: v[1:])), # handle as single quoted Split double quoted strings into parts # Add a terminating token so we can simplify the parsing # double quoted are demuxed # Inject whitespace operator if needed #TODO: handle special escapes \n #TOD...
2.22599
2
example/bayesian-methods/data_loader.py
Vikas-kum/incubator-mxnet
54
3165
<gh_stars>10-100 # 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, Version 2.0 (the # "License...
# 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, Version 2.0 (the # "License"); you may not u...
en
0.865663
# 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, Version 2.0 (the # "License"); you may not u...
1.952904
2
start.py
mickeyckm/nanodegree-freshtomatoes
1
3166
import os import tmdbsimple as tmdb import media import fresh_tomatoes as ft movies = [] if os.environ.get('TMDB_API', False): # Retrieve API KEY tmdb.API_KEY = os.environ['TMDB_API'] # TMDB Movie Ids movie_ids = [271110, 297761, 246655, 278154, 135397, 188927] # Get Configuration configurat...
import os import tmdbsimple as tmdb import media import fresh_tomatoes as ft movies = [] if os.environ.get('TMDB_API', False): # Retrieve API KEY tmdb.API_KEY = os.environ['TMDB_API'] # TMDB Movie Ids movie_ids = [271110, 297761, 246655, 278154, 135397, 188927] # Get Configuration configurat...
en
0.199266
# Retrieve API KEY # TMDB Movie Ids # Get Configuration # Retrieve Image URL # Retrieve Youtube Video URL # Append Movie object # Avatar # Deadpool # Ghostbusters # Olympus # Angry Birds # Ironman
2.594566
3
qiskit_metal/_gui/elements_ui.py
sarafs1926/qiskit-metal
1
3167
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './elements_ui.ui', # licensing of './elements_ui.ui' applies. # # Created: Wed Jun 16 14:29:03 2021 # by: pyside2-uic running on PySide2 5.13.2 # # WARNING! All changes made in this file will be lost! from PySide2 import QtCore, QtGui...
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './elements_ui.ui', # licensing of './elements_ui.ui' applies. # # Created: Wed Jun 16 14:29:03 2021 # by: pyside2-uic running on PySide2 5.13.2 # # WARNING! All changes made in this file will be lost! from PySide2 import QtCore, QtGui...
en
0.80364
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file './elements_ui.ui', # licensing of './elements_ui.ui' applies. # # Created: Wed Jun 16 14:29:03 2021 # by: pyside2-uic running on PySide2 5.13.2 # # WARNING! All changes made in this file will be lost!
1.409581
1
Python/function.py
manishaverma1012/programs
0
3168
def cube(number): return number*number*number digit = input(" the cube of which digit do you want >") result = cube(int(digit)) print(result)
def cube(number): return number*number*number digit = input(" the cube of which digit do you want >") result = cube(int(digit)) print(result)
none
1
4.043183
4
tests/test_runner.py
elifesciences/proofreader-python
1
3169
<reponame>elifesciences/proofreader-python<gh_stars>1-10 try: from unittest.mock import patch except ImportError: # pragma: no cover from mock import patch from proofreader.runner import run, _run_command def test_it_will_return_1_exit_code_on_failure(bad_py_file): try: run(targets=[bad_py_file....
try: from unittest.mock import patch except ImportError: # pragma: no cover from mock import patch from proofreader.runner import run, _run_command def test_it_will_return_1_exit_code_on_failure(bad_py_file): try: run(targets=[bad_py_file.strpath]) except SystemExit as exception: ass...
en
0.475563
# pragma: no cover
2.615842
3
tanim/core/container/container.py
wofeicaoge/Tanim
0
3170
from tanim.utils.config_ops import digest_config from tanim.utils.iterables import list_update # Currently, this is only used by both Scene and Mobject. # Still, we abstract its functionality here, albeit purely nominally. # All actual implementation has to be handled by derived classes for now. class Container(obj...
from tanim.utils.config_ops import digest_config from tanim.utils.iterables import list_update # Currently, this is only used by both Scene and Mobject. # Still, we abstract its functionality here, albeit purely nominally. # All actual implementation has to be handled by derived classes for now. class Container(obj...
en
0.963102
# Currently, this is only used by both Scene and Mobject. # Still, we abstract its functionality here, albeit purely nominally. # All actual implementation has to be handled by derived classes for now. # Is it really better to name it submobjects?
2.461637
2
article.py
ZACHSTRIVES/AUCSS-StaffPlatform
3
3171
from config import * def fetch_all_article(): try: cur = db.cursor() sql = "SELECT * FROM article WHERE article_status='N'" db.ping(reconnect=True) cur.execute(sql) result = cur.fetchall() db.commit() cur.close() return result except Exception as...
from config import * def fetch_all_article(): try: cur = db.cursor() sql = "SELECT * FROM article WHERE article_status='N'" db.ping(reconnect=True) cur.execute(sql) result = cur.fetchall() db.commit() cur.close() return result except Exception as...
none
1
2.949765
3
12-Querying-Data-II/just_filtering.py
dwang-ischool/w205
23
3172
<reponame>dwang-ischool/w205<gh_stars>10-100 #!/usr/bin/env python """Extract events from kafka and write them to hdfs """ import json from pyspark.sql import SparkSession, Row from pyspark.sql.functions import udf @udf('boolean') def is_purchase(event_as_json): event = json.loads(event_as_json) if event['eve...
#!/usr/bin/env python """Extract events from kafka and write them to hdfs """ import json from pyspark.sql import SparkSession, Row from pyspark.sql.functions import udf @udf('boolean') def is_purchase(event_as_json): event = json.loads(event_as_json) if event['event_type'] == 'purchase_sword': return...
en
0.826405
#!/usr/bin/env python Extract events from kafka and write them to hdfs main
2.873791
3
test.py
navjotk/pysz
3
3173
import numpy as np from pysz import compress, decompress def test_compress_decompress(): a = np.linspace(0, 100, num=1000000).reshape((100, 100, 100)).astype(np.float32) tolerance = 0.0001 compressed = compress(a, tolerance=tolerance) recovered = decompress(compressed, a.shape, a.dtype) asse...
import numpy as np from pysz import compress, decompress def test_compress_decompress(): a = np.linspace(0, 100, num=1000000).reshape((100, 100, 100)).astype(np.float32) tolerance = 0.0001 compressed = compress(a, tolerance=tolerance) recovered = decompress(compressed, a.shape, a.dtype) asse...
none
1
2.467478
2
sparkdq/outliers/params/KSigmaParams.py
PasaLab/SparkDQ
1
3174
import json from sparkdq.outliers.params.OutlierSolverParams import OutlierSolverParams from sparkdq.outliers.OutlierSolver import OutlierSolver class KSigmaParams(OutlierSolverParams): def __init__(self, deviation=1.5): self.deviation = deviation def model(self): return OutlierSolver.kSigm...
import json from sparkdq.outliers.params.OutlierSolverParams import OutlierSolverParams from sparkdq.outliers.OutlierSolver import OutlierSolver class KSigmaParams(OutlierSolverParams): def __init__(self, deviation=1.5): self.deviation = deviation def model(self): return OutlierSolver.kSigm...
none
1
2.437094
2
webhooks/sentry/alerta_sentry.py
dunzoit/alerta-contrib
0
3175
<reponame>dunzoit/alerta-contrib from alerta.models.alert import Alert from alerta.webhooks import WebhookBase class SentryWebhook(WebhookBase): def incoming(self, query_string, payload): # For Sentry v9 # Defaults to value before Sentry v9 if 'request' in payload.get('event'): ...
from alerta.models.alert import Alert from alerta.webhooks import WebhookBase class SentryWebhook(WebhookBase): def incoming(self, query_string, payload): # For Sentry v9 # Defaults to value before Sentry v9 if 'request' in payload.get('event'): key = 'request' else: ...
en
0.636659
# For Sentry v9 # Defaults to value before Sentry v9
2.113398
2
XMLHttpRequest/resources/shift-jis-html.py
watilde/web-platform-tests
4
3176
def main(request, response): headers = [("Content-type", "text/html;charset=shift-jis")] # Shift-JIS bytes for katakana TE SU TO ('test') content = chr(0x83) + chr(0x65) + chr(0x83) + chr(0x58) + chr(0x83) + chr(0x67); return headers, content
def main(request, response): headers = [("Content-type", "text/html;charset=shift-jis")] # Shift-JIS bytes for katakana TE SU TO ('test') content = chr(0x83) + chr(0x65) + chr(0x83) + chr(0x58) + chr(0x83) + chr(0x67); return headers, content
en
0.510732
# Shift-JIS bytes for katakana TE SU TO ('test')
2.146823
2
setup.py
dolfim/django-mail-gmailapi
0
3177
import re from setuptools import setup, find_packages import sys if sys.version_info < (3, 5): raise 'must use Python version 3.5 or higher' with open('./gmailapi_backend/__init__.py', 'r') as f: MATCH_EXPR = "__version__[^'\"]+(['\"])([^'\"]+)" VERSION = re.search(MATCH_EXPR, f.read()).group(2).strip() ...
import re from setuptools import setup, find_packages import sys if sys.version_info < (3, 5): raise 'must use Python version 3.5 or higher' with open('./gmailapi_backend/__init__.py', 'r') as f: MATCH_EXPR = "__version__[^'\"]+(['\"])([^'\"]+)" VERSION = re.search(MATCH_EXPR, f.read()).group(2).strip() ...
none
1
1.536432
2
openpeerpower/scripts/ensure_config.py
OpenPeerPower/openpeerpower
0
3178
"""Script to ensure a configuration file exists.""" import argparse import os import openpeerpower.config as config_util from openpeerpower.core import OpenPeerPower # mypy: allow-untyped-calls, allow-untyped-defs def run(args): """Handle ensure config commandline script.""" parser = argparse.ArgumentParser...
"""Script to ensure a configuration file exists.""" import argparse import os import openpeerpower.config as config_util from openpeerpower.core import OpenPeerPower # mypy: allow-untyped-calls, allow-untyped-defs def run(args): """Handle ensure config commandline script.""" parser = argparse.ArgumentParser...
en
0.6157
Script to ensure a configuration file exists. # mypy: allow-untyped-calls, allow-untyped-defs Handle ensure config commandline script. # Test if configuration directory exists Make sure config exists.
2.998376
3
atcoder/abc132A_fifty_fifty.py
uninhm/kyopro
31
3179
# Vicfred # https://atcoder.jp/contests/abc132/tasks/abc132_a # implementation S = list(input()) if len(set(S)) == 2: if S.count(S[0]) == 2: print("Yes") quit() print("No")
# Vicfred # https://atcoder.jp/contests/abc132/tasks/abc132_a # implementation S = list(input()) if len(set(S)) == 2: if S.count(S[0]) == 2: print("Yes") quit() print("No")
en
0.489761
# Vicfred # https://atcoder.jp/contests/abc132/tasks/abc132_a # implementation
3.465086
3
dabl/plot/tests/test_supervised.py
nrohan09-cloud/dabl
500
3180
<reponame>nrohan09-cloud/dabl<gh_stars>100-1000 import pytest import numpy as np import pandas as pd import matplotlib.pyplot as plt import itertools from sklearn.datasets import (make_regression, make_blobs, load_digits, fetch_openml, load_diabetes) from sklearn.preprocessing import KBi...
import pytest import numpy as np import pandas as pd import matplotlib.pyplot as plt import itertools from sklearn.datasets import (make_regression, make_blobs, load_digits, fetch_openml, load_diabetes) from sklearn.preprocessing import KBinsDiscretizer from dabl.preprocessing import cle...
en
0.834744
# FIXME: check that target is not y but a column name # simple smoke test # should be parametrized # get title of figure # one of the labels is 'target' iif regression # check we can plot even if we do classification with a float target # same with "actual float" - we need to specify classification for that :-/ # check...
2.465339
2
scripts/calculate_rank.py
daniel-theis/multicore-test-harness
15
3181
<reponame>daniel-theis/multicore-test-harness ################################################################################ # Copyright (c) 2017 <NAME>, <NAME>, <NAME> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Softwa...
################################################################################ # Copyright (c) 2017 <NAME>, <NAME>, <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 restr...
en
0.6932
################################################################################ # Copyright (c) 2017 <NAME>, <NAME>, <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 restrictio...
2.020563
2
contrib/antlrqueryparser/src/python/generate_asts.py
marblestation/montysolr
24
3182
import sys import subprocess as sub import os """ Simple utility script to generate HTML charts of how ANTLR parses every query and what is the resulting AST. """ def run(grammar_name, basedir='', cp='.:/dvt/antlr-142/lib/antlr-3.4-complete.jar:/x/dev/antlr-34/lib/antlr-3.4-complete.jar', grammardi...
import sys import subprocess as sub import os """ Simple utility script to generate HTML charts of how ANTLR parses every query and what is the resulting AST. """ def run(grammar_name, basedir='', cp='.:/dvt/antlr-142/lib/antlr-3.4-complete.jar:/x/dev/antlr-34/lib/antlr-3.4-complete.jar', grammardi...
en
0.352761
Simple utility script to generate HTML charts of how ANTLR parses every query and what is the resulting AST. #print "We'll generate ANTLR graphs\ngramar: %s\nbasedir: %s\nclasspath: %s\nparserdir: %s" % (grammar_name, basedir, cp, thisdir) # generate AST tree #tmp_dot = os.path.join(basedir, 'tmp-%s.dot' % i) #generate...
2.77667
3
visual_perception/Detection/yolov4/__init__.py
SSusantAchary/Visual-Perception
0
3183
<reponame>SSusantAchary/Visual-Perception """ MIT License Copyright (c) 2020 <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...
""" MIT License Copyright (c) 2020 <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 use, copy, modify, merge, publi...
en
0.734355
MIT License Copyright (c) 2020 <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 use, copy, modify, merge, publish, ...
1.4482
1
server/mqtt/handler.py
rishab-rb/MyIOTMap
1
3184
<reponame>rishab-rb/MyIOTMap import paho.client as mqtt HOST = 'localhost' PORT = 1883 class MQTTConnector: def __init__(self, host, port): host = host port = port client = mqtt.Client() def connect(): self.client.connect(self.host, self.port, 60) def run(sel...
import paho.client as mqtt HOST = 'localhost' PORT = 1883 class MQTTConnector: def __init__(self, host, port): host = host port = port client = mqtt.Client() def connect(): self.client.connect(self.host, self.port, 60) def run(self): self.client.loop_...
none
1
2.824124
3
scripts/spacy_files/similarity_replacement.py
HighDeFing/thesis_v4
0
3185
#!/bin/env python from black import main import spacy import json from spacy import displacy import unidecode import pandas as pd import numpy as np import os csv_source = "scripts/spacy_files/data/thesis_200_with_school.csv" df = pd.read_csv(csv_source) df = df[df['isScan']==False] df = df.sort_values('isScan', asce...
#!/bin/env python from black import main import spacy import json from spacy import displacy import unidecode import pandas as pd import numpy as np import os csv_source = "scripts/spacy_files/data/thesis_200_with_school.csv" df = pd.read_csv(csv_source) df = df[df['isScan']==False] df = df.sort_values('isScan', asce...
es
0.374452
#!/bin/env python #print(facultad['escuela']) # make the list flat #print(escuelas)
3.088153
3
test/unittest_base.py
dat-boris/tensorforce
0
3186
<filename>test/unittest_base.py # Copyright 2018 Tensorforce Team. 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 # # ...
<filename>test/unittest_base.py # Copyright 2018 Tensorforce Team. 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 # # ...
en
0.770794
# Copyright 2018 Tensorforce Team. 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...
2.183718
2
mspray/apps/reveal/__init__.py
onaio/mspray
0
3187
"""init module for reveal app""" # pylint: disable=invalid-name default_app_config = "mspray.apps.reveal.apps.RevealConfig" # noqa
"""init module for reveal app""" # pylint: disable=invalid-name default_app_config = "mspray.apps.reveal.apps.RevealConfig" # noqa
en
0.330761
init module for reveal app # pylint: disable=invalid-name # noqa
1.199041
1
guifw/models/port.py
luizerico/PyGuiFW
1
3188
from django.db import models from django import forms from audit_log.models.managers import AuditLog # Create your models here. class Port(models.Model): name = models.CharField(max_length=250) port = models.CharField(max_length=250) description = models.TextField(blank=True) audit_log = AuditLog()...
from django.db import models from django import forms from audit_log.models.managers import AuditLog # Create your models here. class Port(models.Model): name = models.CharField(max_length=250) port = models.CharField(max_length=250) description = models.TextField(blank=True) audit_log = AuditLog()...
en
0.43221
# Create your models here. #icon = models.ImageField(upload_to='images', blank=True)
2.086133
2
app/backend/arm/migrations/0002_auto_20190924_1712.py
karstenv/nmp-arm
2
3189
<reponame>karstenv/nmp-arm # Generated by Django 2.2.5 on 2019-09-25 00:12 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('arm', '0001_initial'), ] operations = [ migrations.DeleteModel( name='CautionMessage', ...
# Generated by Django 2.2.5 on 2019-09-25 00:12 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('arm', '0001_initial'), ] operations = [ migrations.DeleteModel( name='CautionMessage', ), migrations.Dele...
en
0.74274
# Generated by Django 2.2.5 on 2019-09-25 00:12
1.329752
1
webcam_demo.py
taranek/tennis-stats-provider
0
3190
import tensorflow as tf import json import math import cv2 import time import argparse import concurrent.futures import posenet import keyboard import sys import numpy as np from threading import Thread from slugify import slugify parser = argparse.ArgumentParser() parser.add_argument('--model', type=int, default=101)...
import tensorflow as tf import json import math import cv2 import time import argparse import concurrent.futures import posenet import keyboard import sys import numpy as np from threading import Thread from slugify import slugify parser = argparse.ArgumentParser() parser.add_argument('--model', type=int, default=101)...
en
0.340439
# tf.config.threading.set_inter_op_parallelism_threads(0) # tf.config.threading.set_intra_op_parallelism_threads(0) # print(tf.config.threading.get_inter_op_parallelism_threads()) # print(tf.config.threading.get_intra_op_parallelism_threads()) # ret,frame1 = cap.read() # ret,frame2 = cap.read() # diff = cv2.absdiff(fra...
2.228778
2
otcextensions/tests/unit/osclient/dcs/v1/fakes.py
zsoltn/python-otcextensions
0
3191
# 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 # distrib...
# 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 # distrib...
en
0.823958
# 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 # distrib...
1.893053
2
tests/dummy_repo/tvm/python/tvm/api.py
csullivan/ffi-navigator
148
3192
from ._ffi.base import string_types from ._ffi.object import register_object, Object from ._ffi.node import register_node, NodeBase from ._ffi.node import convert_to_node as _convert_to_node from ._ffi.node_generic import _scalar_type_inference from ._ffi.function import Function from ._ffi.function import _init_api, r...
from ._ffi.base import string_types from ._ffi.object import register_object, Object from ._ffi.node import register_node, NodeBase from ._ffi.node import convert_to_node as _convert_to_node from ._ffi.node_generic import _scalar_type_inference from ._ffi.function import Function from ._ffi.function import _init_api, r...
none
1
1.676365
2
torchattacks/attacks/multiattack.py
Harry24k/adversarial-attacks-pytorch
782
3193
<filename>torchattacks/attacks/multiattack.py import copy import torch from ..attack import Attack class MultiAttack(Attack): r""" MultiAttack is a class to attack a model with various attacks agains same images and labels. Arguments: model (nn.Module): model to attack. attacks (list): l...
<filename>torchattacks/attacks/multiattack.py import copy import torch from ..attack import Attack class MultiAttack(Attack): r""" MultiAttack is a class to attack a model with various attacks agains same images and labels. Arguments: model (nn.Module): model to attack. attacks (list): l...
en
0.713067
MultiAttack is a class to attack a model with various attacks agains same images and labels. Arguments: model (nn.Module): model to attack. attacks (list): list of attacks. Examples:: >>> atk1 = torchattacks.PGD(model, eps=8/255, alpha=2/255, iters=40, random_start=True) >>> at...
3.170273
3
src/manager/om/script/gspylib/inspection/items/os/CheckPortConflict.py
wotchin/openGauss-server
1
3194
# -*- coding:utf-8 -*- # Copyright (c) 2020 Huawei Technologies Co.,Ltd. # # openGauss is licensed under Mulan PSL v2. # You can use this software according to the terms # and conditions of the Mulan PSL v2. # You may obtain a copy of Mulan PSL v2 at: # # http://license.coscl.org.cn/MulanPSL2 # # THIS SOFTWARE...
# -*- coding:utf-8 -*- # Copyright (c) 2020 Huawei Technologies Co.,Ltd. # # openGauss is licensed under Mulan PSL v2. # You can use this software according to the terms # and conditions of the Mulan PSL v2. # You may obtain a copy of Mulan PSL v2 at: # # http://license.coscl.org.cn/MulanPSL2 # # THIS SOFTWARE...
en
0.613163
# -*- coding:utf-8 -*- # Copyright (c) 2020 Huawei Technologies Co.,Ltd. # # openGauss is licensed under Mulan PSL v2. # You can use this software according to the terms # and conditions of the Mulan PSL v2. # You may obtain a copy of Mulan PSL v2 at: # # http://license.coscl.org.cn/MulanPSL2 # # THIS SOFTWARE...
2.041606
2
_scripts/_build.py
dfreeman06/wxyz
1
3195
import subprocess import sys from . import ROOT, PY_SRC, _run, PY, DIST CONDA_ORDER = [ "core", "html", "lab", "datagrid", "svg", "tpl-jjinja" "yaml" ] CONDA_BUILD_ARGS = [ "conda-build", "-c", "conda-forge", "--output-folder", DIST / "conda-bld", ] if __name__ == "__main__": f...
import subprocess import sys from . import ROOT, PY_SRC, _run, PY, DIST CONDA_ORDER = [ "core", "html", "lab", "datagrid", "svg", "tpl-jjinja" "yaml" ] CONDA_BUILD_ARGS = [ "conda-build", "-c", "conda-forge", "--output-folder", DIST / "conda-bld", ] if __name__ == "__main__": f...
none
1
1.732144
2
scripts/C189/C189Checkin.py
xiaopowanyi/py_scripts
2
3196
<gh_stars>1-10 import requests, time, re, rsa, json, base64 from urllib import parse s = requests.Session() username = "" password = "" if(username == "" or password == ""): username = input("账号:") password = input("密码:") def main(): login(username, password) rand = str(round(time.time()*1000)) ...
import requests, time, re, rsa, json, base64 from urllib import parse s = requests.Session() username = "" password = "" if(username == "" or password == ""): username = input("账号:") password = input("密码:") def main(): login(username, password) rand = str(round(time.time()*1000)) surl = f'https:...
none
1
2.70425
3
Mmint/CGratio.py
lijiacd985/Mplot
5
3197
import subprocess from .Genome_fasta import get_fasta import matplotlib matplotlib.use('Agg') from matplotlib import pyplot as plt import numpy as np import pysam def run(parser): args = parser.parse_args() bases,chrs = get_fasta(args.genome) l={} for c in chrs: l[c]=len(bases[c]) chrs = se...
import subprocess from .Genome_fasta import get_fasta import matplotlib matplotlib.use('Agg') from matplotlib import pyplot as plt import numpy as np import pysam def run(parser): args = parser.parse_args() bases,chrs = get_fasta(args.genome) l={} for c in chrs: l[c]=len(bases[c]) chrs = se...
en
0.319142
#p = subprocess.Popen('bamToBed -i '+args.bamfile,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE) #CG,cg,Cg #t = line.decode('utf-8').strip().split() #t[0] # True +strand; False -strand #=='+': #We need to consider strand specific situation. #'+' strand we have CG but '-' we should count 'GC'. #print cg # ...
2.318079
2
src/furo/__init__.py
sethmlarson/furo
0
3198
<reponame>sethmlarson/furo<filename>src/furo/__init__.py """A clean customisable Sphinx documentation theme.""" __version__ = "2020.9.8.beta2" from pathlib import Path from .body import wrap_tables from .code import get_pygments_style_colors from .navigation import get_navigation_tree from .toc import should_hide_to...
"""A clean customisable Sphinx documentation theme.""" __version__ = "2020.9.8.beta2" from pathlib import Path from .body import wrap_tables from .code import get_pygments_style_colors from .navigation import get_navigation_tree from .toc import should_hide_toc def _html_page_context(app, pagename, templatename, c...
en
0.546855
A clean customisable Sphinx documentation theme. # Custom Navigation Tree (adds checkboxes and labels) # Custom "should hide ToC" logic # Allow for hiding toc via ToC in page-wide metadata. # Inject information about styles # Patch the content Entry point for sphinx theming.
2.151228
2
experiments/mix_down.py
fretboardfreak/potty_oh
0
3199
#!/usr/bin/env python3 # Copyright 2016 <NAME> # # 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 ...
#!/usr/bin/env python3 # Copyright 2016 <NAME> # # 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 ...
en
0.856552
#!/usr/bin/env python3 # Copyright 2016 <NAME> # # 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 ...
2.777471
3