content
stringlengths
7
928k
avg_line_length
float64
3.5
33.8k
max_line_length
int64
6
139k
alphanum_fraction
float64
0.08
0.96
licenses
list
repository_name
stringlengths
7
104
path
stringlengths
4
230
size
int64
7
928k
lang
stringclasses
1 value
""" Django settings for toDoList project. Generated by 'django-admin startproject' using Django 2.1.7. For more information on this file, see https://docs.djangoproject.com/en/2.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.1/ref/settings/ """ ...
27.046875
92
0.659445
[ "MIT" ]
ruoyunruyan/toDoList
toDoList/toDoList/settings.py
3,462
Python
from .spark_cluster import SparkCluster from staroid import Staroid import requests import os, stat, time from pathlib import Path class Ods: def __init__(self, staroid=None, ske=None, cache_dir=None): self.__ske = None if staroid == None: self._staroid = Staroid() else: ...
31.542857
68
0.611413
[ "MIT" ]
open-datastudio/ods
ods/ods.py
4,416
Python
# -*- coding:utf-8 -*- from sqlalchemy.sql import text def getAttributesTaxon( connection, cd_ref, attrDesc, attrComment, attrMilieu, attrChoro ): sql = """ SELECT * FROM atlas.vm_cor_taxon_attribut WHERE id_attribut IN (:thisattrDesc, :thisattrComment, :thisattrMilieu, :thisattrChor...
28.268293
95
0.610009
[ "BSD-2-Clause" ]
Splendens/atlas_biodiv_pdl
main/modeles/repositories/vmCorTaxonAttribut.py
1,159
Python
# -*- coding: utf-8 -*- # Copyright 2020 The PsiZ 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 r...
33.266871
78
0.636146
[ "Apache-2.0" ]
rgerkin/psiz
examples/rank/mle_3g.py
10,845
Python
#Reverse the input array # input : {5,4,3,2,1} # output : {1,2,3,4,5} arr = list(map(int,input().split())) for i in range(len(arr)): arr.push(a[-1]) arr.remove(a[-1]) print(arr)
18.7
36
0.582888
[ "MIT" ]
montukv/Coding-problem-solutions
Python/test.py
187
Python
import logging import random import string import sys import time import unittest import apiritif def setup(): target = apiritif.http.target('http://localhost:8000/') target.keep_alive(True) target.auto_assert_ok(True) target.use_cookies(True) target.allow_redirects(True) vars = { ...
21.666667
67
0.648352
[ "Apache-2.0" ]
adrianantonypillai/taurus
tests/resources/apiritif/test_vars.py
910
Python
import pafy url = "https://www.youtube.com/watch?v=OE7wUUpJw6I&list=PL2_aWCzGMAwLPEZrZIcNEq9ukGWPfLT4A" video = pafy.new(url) print(video.title) stream=pafy.new(url).streams best=video.getbest() for i in stream: print(i) print(best.resolution,best.extension) print(best.url) best.download(quiet=False)
22
91
0.775974
[ "MIT" ]
bgoonz/bash-commands-walkthrough
steps/3-clean-up-fluf/DS-ALGO-OFFICIAL-master/CONTENT/DS-n-Algos/ALGO/__PYTHON/YT_DOWN.py
308
Python
import pandas as pd import time from google import google import sys from A00_File_name import file_name file_df = pd.read_csv(file_name, sep=';', encoding='latin-1') print(file_df.head()) brand_names_list = file_df['Official Chain Name'].tolist() ''' create a column with Official Brand WWWs ''' # ...
27.202532
108
0.585389
[ "MIT" ]
ancago/search-download-favicons-from-web
A01_WEB_BROWSER_get_Official_WWWs_create_COM_domain.py
2,149
Python
"""Representation of a WeMo Motion device.""" from .api.long_press import LongPressMixin from .switch import Switch class LightSwitch(Switch, LongPressMixin): """Representation of a WeMo Motion device.""" def __repr__(self): """Return a string representation of the device.""" return '<WeMo Li...
28.823529
67
0.677551
[ "MIT" ]
GarlicToum/pywemo
pywemo/ouimeaux_device/lightswitch.py
490
Python
import requests import json class BuddyAPI(): ''' An API of buddymojo.com :returns: An API ''' def __init__(self): self.payload = {'type': 'friend', 'action': 'finish'} self.payloadf = {'userQuizId': 1, 'type': 'friend', ...
31.04386
79
0.514552
[ "MIT" ]
jasonjustin/BuddymojoAPI
buddymojoAPI/BuddyMojoAPI.py
3,539
Python
# Copyright 2021 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...
37.736842
89
0.709305
[ "Apache-2.0" ]
1-punchMan/models
official/vision/beta/modeling/factory_test.py
5,019
Python
from model import * from data import * from keras.preprocessing.image import ImageDataGenerator os.environ["CUDA_VISIBLE_DEVICES"] = "1" data_gen_args = dict(rotation_range=0.2, width_shift_range=0.05, height_shift_range=0.05, shear_range=0.05, ...
33.283784
103
0.688185
[ "MIT" ]
twinkle0331/unet
main.py
2,463
Python
# © Copyright IBM Corporation 2020. # # LICENSE: Apache License 2.0 (Apache-2.0) # http://www.apache.org/licenses/LICENSE-2.0 """ ... """ # init file # import cython created shared object files import sib.c_package # cython with cpp version # import core functionality from .sib_main import * from ._version impor...
17.818182
47
0.734694
[ "Apache-2.0" ]
IBM/sib
src/sib/__init__.py
393
Python
#!/usr/bin/python3 from sys import version_info from setuptools import setup if version_info < (3, 5, 3): raise RuntimeError("aiopm requires Python 3.5.3+") setup( name='aiopm', version='1.1', description='Async Postmark client (asyncio)', classifiers=[ 'Intended Audience :: Developers', ...
30.086957
55
0.584538
[ "MIT" ]
vit1251/aiopm
setup.py
1,384
Python
from .basic import models as basic_models models = {}
18
41
0.759259
[ "MIT" ]
R-N/sistem_gaji_vue_thrift
backend/models/manager.py
54
Python
import halide as hl import simple_stub import complex_stub def _realize_and_check(f, offset = 0): b = hl.Buffer(hl.Float(32), [2, 2]) f.realize(b) assert b[0, 0] == 3.5 + offset + 123 assert b[0, 1] == 4.5 + offset + 123 assert b[1, 0] == 4.5 + offset + 123 assert b[1, 1] == 5.5 + offset + 1...
33.656716
119
0.600665
[ "Apache-2.0" ]
derek-gerstmann/Halide
python_bindings/correctness/pystub.py
9,020
Python
from logger import elog, mlog, alog from db_engine import mysql_connect, mysql_reconnect, get_qs, \ estr, valid_pass, SQLParamError, sql_selectall, \ sql_insertinto, do_param_error, sq, sql_update import random, time, json, os, os.path, sys, math, types from utils import * from...
23.996333
109
0.564777
[ "MIT" ]
joeedh/fairmotion
pyserver/fileapi_local.py
19,629
Python
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
31.613636
109
0.744788
[ "Apache-2.0" ]
jesman/hue
apps/spark/src/spark/conf.py
1,391
Python
""" Module holds JMX handlers implementations Copyright 2017 BlazeMeter Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by appli...
42.322129
120
0.596863
[ "Apache-2.0" ]
greyfenrir/taurus
bzt/jmx/tools.py
30,218
Python
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import socket import struct import asyncio @asyncio.coroutine def proxy_data(reader, writer): try: while 1: buf = yield from reader.read(4096) if not buf: break writer.write(buf) yield...
33.386861
82
0.554438
[ "MIT" ]
gumblex/ptproxy
socksserver.py
4,574
Python
# coding: utf-8 """ Properties All HubSpot objects store data in default and custom properties. These endpoints provide access to read and modify object properties in HubSpot. # noqa: E501 The version of the OpenAPI document: v3 Generated by: https://openapi-generator.tech """ import pprint import...
31.15894
195
0.609564
[ "Apache-2.0" ]
cclauss/hubspot-api-python
hubspot/crm/properties/models/property_group_update.py
4,705
Python
from __future__ import print_function import sys import logging import os os.environ['ENABLE_CNNL_TRYCATCH'] = 'OFF' # pylint: disable=C0413 from itertools import product import unittest import torch import torch_mlu.core.mlu_model as ct cur_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.append(cur_dir + "...
51.25731
98
0.539875
[ "BSD-2-Clause" ]
Cambricon/catch
test/cnnl/op_test/test_type.py
8,765
Python
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """email package exception classes.""" class MessageError(Exception): """Base class for errors in the email package.""" class MessageParseError(MessageError): """Base class for message parsing errors...
32.731481
79
0.742857
[ "Apache-2.0" ]
0xFireball/exascript2
Src/StdLib/Lib/email/errors.py
3,535
Python
from unittest.mock import ANY, AsyncMock, MagicMock, create_autospec, patch import aioredis import pytest from tests.utils import Keys from aiocache.backends.redis import RedisBackend, RedisCache, conn from aiocache.base import BaseCache from aiocache.serializers import JsonSerializer pytest.skip("aioredis code is b...
36.177143
94
0.675407
[ "BSD-3-Clause" ]
argaen/aiocache
tests/ut/backends/test_redis.py
12,662
Python
from __future__ import absolute_import from mock import patch from kombu import Connection, Exchange, Queue from kombu import compat from .mocks import Transport, Channel from .utils import TestCase from .utils import Mock class test_misc(TestCase): def test_iterconsume(self): class MyConnection(obje...
35.716049
76
0.571638
[ "BSD-3-Clause" ]
chartbeat/kombu
kombu/tests/test_compat.py
11,572
Python
from django.db.models import Max from datahub.company.models import Company as DBCompany, CompanyPermission from datahub.core.query_utils import get_aggregate_subquery from datahub.search.apps import SearchApp from datahub.search.company.models import Company class CompanySearchApp(SearchApp): """SearchApp for c...
30.675
74
0.685412
[ "MIT" ]
reupen/data-hub-api
datahub/search/company/apps.py
1,227
Python
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_script import Manager from flask_migrate import Migrate, MigrateCommand from app import create_app app, db = create_app(minimal=True) migrate = Migrate(app, db) manager = Manager(app) manager.add_command('db', MigrateCommand) if __name__ == ...
21.875
49
0.788571
[ "Apache-2.0" ]
Info-ag/labplaner
manage.py
350
Python
import Gramatica.Gramatica as g import graphviz import sys import threading import Errores.Nodo_Error as error import Errores.ListaErrores as lista_err from tkinter import * from tkinter import filedialog from tkinter import font from tkinter import ttk #------------------------------------ Interfaz ------------------...
31.649485
137
0.713355
[ "MIT" ]
3liezerSong/tytus
parser/team19/BDTytus/main.py
3,070
Python
import random # averaging the embeddings between 2 words # return the averaged embeddings def average_two_embeddings_vectors(a, b): avg_embeddings = [] i = 0 for embed in a: z = (embed + b[i]) / 2.0 avg_embeddings.append(z) i += 1 return avg_embeddings # helper func; updates...
40.423469
119
0.616686
[ "MIT" ]
AMOOOMA/stocktwits-svm-nlp
support/standardize.py
7,923
Python
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
51.655629
265
0.686026
[ "MIT" ]
AlexanderYukhanov/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/v2017_03_30/models/virtual_machine_py3.py
7,800
Python
# a = 15*15 + 14*14 + 13*13 + 12*12 + 11*11 # print(a) # a = 3**33333333 % 100 # b = 7**77777777 % 10 # print(a * b) # x = 6 # y = 4 # z = 0 # for i in range(1,14): # z += x*y # y += 1 # x += # print(x, y, z) # print(z) # idx = 0 # a = [5,10,20,50,100] # for i in a: ax = ...
13.433333
44
0.37469
[ "Unlicense" ]
Mhmdaris15/free-python-project
Code Politan/KSI POSI INFORMATIKA.py
403
Python
import dj_database_url SECRET_KEY = 'django-migration-docs' # Install the tests as an app so that we can make test models INSTALLED_APPS = ['migration_docs', 'migration_docs.tests'] # Database url comes from the DATABASE_URL env var DATABASES = {'default': dj_database_url.config()}
31.666667
61
0.778947
[ "BSD-3-Clause" ]
Opus10/django-migration-docs
settings.py
285
Python
# -*- coding: utf-8 -*- # Copyright (C) 2018 by # Marta Grobelna <marta.grobelna@rwth-aachen.de> # Petre Petrov <petrepp4@gmail.com> # Rudi Floren <rudi.floren@gmail.com> # Tobias Winkler <tobias.winkler1@rwth-aachen.de> # All rights reserved. # BSD license. # # Authors: Marta Grobelna <marta.grob...
40.293785
118
0.642316
[ "BSD-3-Clause" ]
petrovp/networkx-related
planar_graph_sampler/combinatorial_classes/dissection.py
7,132
Python
from flask import Flask, render_template, request, flash, url_for from flask_mail import Message, Mail import json from typing import Dict, List from pathlib import Path from forms import ContactForm from development_config import Config """ This file launches the application. """ # init application app = Flask(__nam...
27.898305
80
0.620899
[ "MIT" ]
Jim-Shaddix/Personal-Website
app.py
3,292
Python
import numpy as np from caffe2.python import core, workspace from caffe2.python.test_util import TestCase from caffe2.proto import caffe2_pb2 class TestPrependDim(TestCase): def _test_fwd_bwd(self): old_shape = (128, 2, 4) new_shape = (8, 16, 2, 4) X = np.random.rand(*o...
29.923077
74
0.619537
[ "MIT" ]
Westlanderz/AI-Plat1
venv/Lib/site-packages/caffe2/python/operator_test/prepend_dim_test.py
1,556
Python
# coding: utf-8 import attr from ..util.log import sanitize_dictionary @attr.s(slots=True) class BoxRequest: """Represents a Box API request. :param url: The URL being requested. :type url: `unicode` :param method: The HTTP method to use for...
36.147059
113
0.619203
[ "Apache-2.0" ]
DaveSawyer/box-python-sdk
boxsdk/session/box_request.py
1,229
Python
#!/usr/bin/env python """The setup script.""" from setuptools import setup, find_packages with open('README.rst') as readme_file: readme = readme_file.read() setup( author="Faris A Chugthai", author_email='farischugthai@gmail.com', description="Python Boilerplate contains all the boilerplate you nee...
25.676471
103
0.683849
[ "MIT" ]
farisachugthai/fatal_police_shootings
setup.py
873
Python
import tensorflow as tf import numpy as np import os from tqdm import tqdm import argparse from utils.utils import create_tfr_files, prob_to_secondary_structure from utils.FastaMLtoSL import FastaMLtoSL import time start = time.time() from argparse import RawTextHelpFormatter parser = argparse.ArgumentParser() parser....
44.163462
233
0.679948
[ "MPL-2.0" ]
MuhammedHasan/SPOT-RNA
SPOT-RNA.py
4,593
Python
import os,sys import cytnx as cy class Hising(cy.LinOp): def __init__(self,L,J,Hx): cy.LinOp.__init__(self,"mv_elem",2**L,cy.Type.Double,cy.Device.cpu) ## custom members: self.J = J self.Hx = Hx self.L = L def SzSz(self,i,j,ipt_id): return ipt_id,(1. - ...
25.31746
75
0.450784
[ "Apache-2.0" ]
j9263178/Cytnx
example/ED/ed_ising_mve.py
1,595
Python
#!/usr/bin/env python """ Translator Class and builder """ from __future__ import print_function import codecs import os import math import torch from tensorboardX import SummaryWriter from others.utils import rouge_results_to_str, test_rouge, tile from translate.beam import GNMTGlobalScorer def build_predictor(ar...
39.641026
214
0.545337
[ "MIT" ]
SebastianVeile/PreSumm
src/models/predictor.py
17,006
Python
# -*- coding: utf-8 -*- __version__ = "3.0.0.dev0" try: __EMCEE3_SETUP__ except NameError: __EMCEE3_SETUP__ = False if not __EMCEE3_SETUP__: __all__ = [ "moves", "pools", "autocorr", "Model", "SimpleModel", "Sampler", "Ensemble", "State", ...
18.740741
41
0.583004
[ "MIT" ]
dfm/emcee3
emcee3/__init__.py
506
Python
# Copyright 2020 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...
43.836653
80
0.436154
[ "Apache-2.0" ]
AseiSugiyama/tensorboard
tensorboard/data/experimental/experiment_from_dev_test.py
11,003
Python
import asyncio import functools import importlib import inspect import logging from typing import Text, Dict, Optional, Any, List, Callable, Collection, Type from rasa.shared.exceptions import RasaException logger = logging.getLogger(__name__) def class_from_module_path( module_path: Text, lookup_path: Optional...
33.607843
88
0.647025
[ "Apache-2.0" ]
GCES-2021-1/rasa
rasa/shared/utils/common.py
6,859
Python
from datetime import datetime class Worklog: def __init__(self, name: str, date: datetime, issue_id: str, duration: float): self.issue_id = issue_id self.name = name self.date = date self.duration = duration
24.6
82
0.650407
[ "Apache-2.0" ]
dimterex/outlook2tracker
modules/models/worklog.py
246
Python
# Generated by Django 3.1 on 2020-08-08 05:58 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] opera...
36.392857
164
0.663395
[ "MIT" ]
LaudateCorpus1/summer-code-jam-2020
prickly-pufferfish/arena/battle/migrations/0001_initial.py
1,019
Python
from django.contrib import admin from leaflet.admin import LeafletGeoAdmin from .models import ProblemLabel, ProblemStatus # Register your models here. admin.site.register(ProblemLabel, LeafletGeoAdmin) admin.site.register(ProblemStatus)
22
50
0.834711
[ "MIT" ]
3ANov/spbauto_map
app/problem_register/admin.py
242
Python
from pygments.lexers import Python3Lexer from pygments.token import Comment, Keyword, Name, Number, Operator, Punctuation, String def is_comment(token): return token in Comment def is_decorator(token): return token in Name.Decorator def is_function(token): return token in Name.Function def is_builti...
19.986301
88
0.663468
[ "Apache-2.0" ]
4bhishek10/prefect
docs/tokenizer.py
1,459
Python
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Transform a roidb into a trainable roidb by adding a bunch of metada...
41.142857
80
0.626157
[ "MIT" ]
sx14/hierarchical-relationship
lib/roi_data_layer/roidb.py
5,184
Python
"""This module contains the general information for AdaptorFruCapRef ManagedObject.""" import sys, os from ...ucsmo import ManagedObject from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta from ...ucsmeta import VersionMeta class AdaptorFruCapRefConsts(): IS_SUPPORTED_NO = "no" IS_SUPPORTED_YES = "...
52.413793
253
0.652632
[ "Apache-2.0" ]
anoop1984/python_sdk
ucsmsdk/mometa/adaptor/AdaptorFruCapRef.py
3,040
Python
# 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...
41.642424
91
0.665842
[ "Apache-2.0" ]
ABAPPLO/Mxnetonspark
example/gluon/kaggle_k_fold_cross_validation.py
6,871
Python
#!/usr/bin/env python3 class Solution: def removeDuplicates(self, nums): i, ret = 0, 0 for j, n in enumerate(nums): if nums[i] == n and j-i < 2: ret += 1 elif nums[i] != n: i = j ret += 1 return ret sol = Solution() nu...
20.666667
40
0.465438
[ "MIT" ]
eroicaleo/LearningPython
interview/leet/80_Remove_Duplicates_from_Sorted_Array_II_v2.py
434
Python
#!/usr/bin/env python3 from string import ascii_uppercase from re import fullmatch from time import sleep from random import Random # Default game presets. testing_preset = {'height': 10, 'width': 10, '5_ships': 0, '4_ships': 0, '3_ships': 0, '2_ships': 2, '1_ships': 0, 'allow_mines': True, 'allow_moves': True, 'mine...
49.176285
308
0.466789
[ "MIT" ]
GamrCorps/STEMExpoBattleship
battleship.py
62,208
Python
from aiocloudflare.commons.auth import Auth class Domains(Auth): _endpoint1 = "accounts" _endpoint2 = "registrar/domains" _endpoint3 = None
19.25
43
0.727273
[ "MIT" ]
Stewart86/aioCloudflare
aiocloudflare/api/accounts/registrar/domains/domains.py
154
Python
#!/usr/bin/python # # Copyright 2018-2020 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
30.712963
86
0.682243
[ "Apache-2.0" ]
gregmbi/polyaxon
core/polyaxon/schemas/types/dockerfile.py
3,317
Python
from typing import Any, Callable import dask import dask.dataframe as dd def map_on_partition_index( df: dd.DataFrame, f: Callable, *args: Any, **kwargs: Any ) -> dd.DataFrame: meta = kwargs.pop("meta", None) return dd.from_delayed( [ dask.delayed(f)(partition, partition_number, *args...
24.444444
73
0.638636
[ "MIT" ]
galipremsagar/dask-sql
dask_sql/physical/utils/map.py
440
Python
import os # toolchains options ARCH='arm' CPU='cortex-m3' CROSS_TOOL='gcc' # bsp lib config BSP_LIBRARY_TYPE = None if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') if os.getenv('RTT_ROOT'): RTT_ROOT = os.getenv('RTT_ROOT') # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute...
26.342105
152
0.578172
[ "Apache-2.0" ]
Ackleys/rt-thread
bsp/stm32/stm32f103-mini-system/rtconfig.py
4,004
Python
""" WSGI config for thirdproject project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault('DJANGO_...
23.588235
78
0.790524
[ "MIT" ]
LikeLionSCH/Django_Example
3_thirdproject/thirdproject/wsgi.py
401
Python
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # tar command: # tar czvf mugshots.tar.gz -T mugshot_files.txt # where the txt is generated by this script import django django.setup() from django.conf import settings from djforms.scholars.models import Presentation from djtools.fields import TODAY YEAR = int(TODAY...
21.896552
68
0.729134
[ "Unlicense" ]
carthage-college/django-djforms
djforms/scholars/tar_mugshots.py
635
Python
from ibis.sql.compiler import DDL, DML from .compiler import quote_identifier, _type_to_sql_string import re fully_qualified_re = re.compile(r"(.*)\.(?:`(.*)`|(.*))") def _is_fully_qualified(x): return bool(fully_qualified_re.search(x)) def _is_quoted(x): regex = re.compile(r"(?:`(.*)`|(.*))") quoted,...
24.225728
79
0.604949
[ "Apache-2.0" ]
andrewseidl/ibis
ibis/mapd/ddl.py
9,981
Python
# this script finds all the intersecting tiles for a given input AOI, and then downloads corresponding # 0.5 meter AHN3 DSM and DTM tiles from shapely.geometry import Polygon import geopandas as gpd import pandas as pd from tqdm import tqdm from multiprocessing import Pool import urllib.request import zipfile import ...
34.007353
102
0.651892
[ "MIT" ]
seedlit/ahn3-downloader
download_ahn3_elevation_data.py
4,625
Python
from typing import Optional, List from discord import Member from config import PERMITTED_ROLE_IDS from src.util.includes import includes def is_authorized_member(member: Member, authorized_ids: Optional[List[int]] = None) -> bool: if not authorized_ids: authorized_ids = PERMITTED_ROLE_IDS member_r...
22.809524
93
0.728601
[ "MIT" ]
Colk-tech/discoplug
src/discord/operations/util/authorized.py
479
Python
import boto3 from queuing_hub.conn.base import BasePub, BaseSub class AwsBase(): def __init__(self, profile_name=None): session = boto3.Session(profile_name=profile_name) self._client = session.client('sqs') self._queue_list = self._client.list_queues()['QueueUrls'] class AwsPub(AwsBas...
28.72
74
0.626393
[ "MIT" ]
tosh223/pmltq
queuing_hub/conn/aws.py
2,872
Python
from django.test import TestCase from django.urls import reverse from rest_framework.test import APIClient from rest_framework import status from core.models import Recipe, Ingredient RECIPE_URL = reverse('recipe:recipe-list') def recipe_url(id): """Construct URL for a single recipe based on its ID""" retu...
31.889423
79
0.599276
[ "MIT" ]
jamie-chapman/django-exercise-recipe-app
app/recipe/tests/test_recipe_api.py
6,633
Python
# 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 use ...
31.30303
74
0.720232
[ "Apache-2.0" ]
sberdevices/ignite-python-thin-client
examples/failover.py
2,068
Python
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables from...
50.361314
926
0.714545
[ "Apache-2.0" ]
pulumi/pulumi-azure-nextgen
sdk/python/pulumi_azure_nextgen/network/v20200701/get_application_gateway.py
27,598
Python
from __future__ import (absolute_import, division,print_function, unicode_literals) from builtins import * import numpy as np import cv2 import SimpleITK as sitk from builtins import * from scipy.spatial import distance import sys import time ############### FUNCTIONS ########################## def imcomplem...
29.243056
119
0.594039
[ "MIT" ]
ficusoftdeveloper/bluedome
scripts/image/crack_detection_fast.py
8,422
Python
#%% First import numpy as np import json import os import pandas as pd import requests from contextlib import closing import time from datetime import datetime from requests.models import HTTPBasicAuth import seaborn as sns from matplotlib import pyplot as plt from requests import get from requests_futures.sessions imp...
33.901528
120
0.565254
[ "MIT" ]
GBruening/succes_predictor
Pulling data/apiv2_pull.py
19,968
Python
from Tkinter import * from Tkinter import Text as textcontrol class StyledTextControl( textcontrol ): def spaces(self, val): return str(val*8) def __screen(self, width, height): self. def __init__(self, parent, width, height, fontf, fontsize): # Predefining Variables ...
36.76
129
0.607182
[ "Apache-2.0" ]
CofeePy/Cofee
lib/stc.py
919
Python
# Copyright 2021 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
35.263158
77
0.731343
[ "Apache-2.0" ]
openstack/tripleo-repos
tests/unit/yum_config/mock_modules.py
670
Python
from litex.soc.cores import uart from litex.soc.cores.uart import UARTWishboneBridge from litedram.frontend.bist import LiteDRAMBISTGenerator, LiteDRAMBISTChecker from litescope import LiteScopeAnalyzer from litescope import LiteScopeIO from gateware.memtest import LiteDRAMBISTCheckerScope from targets.utils import...
29.830189
109
0.654016
[ "BSD-2-Clause" ]
CarlFK/HDMI2USB-litex-firmware
targets/mimasv2/scope.py
1,581
Python
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at https://mozilla.org/MPL/2.0/. from __future__ import absolute_import, print_function from distutils.spawn import find_executable from distutils.vers...
36.192857
104
0.600289
[ "MPL-2.0", "MPL-2.0-no-copyleft-exception" ]
Florian-Schoenherr/servo
python/servo/bootstrap.py
15,201
Python
#!/usr/bin/env python from setuptools import setup, find_packages from codecs import open from os import path here = path.abspath(path.dirname(__file__)) # Get the long description from the README file with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() setup( name='p...
27.066667
68
0.644499
[ "BSD-2-Clause" ]
luttermann/pystadel
setup.py
1,218
Python
""" Copyright (c) 2016-present, Facebook, Inc. All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. An additional grant of patent rights can be found in the PATENTS file in the same directory. """ import unittest import s1a...
32.55
78
0.667819
[ "BSD-3-Clause" ]
119Vik/magma-1
lte/gateway/python/integ_tests/s1aptests/test_sctp_abort_after_smc.py
2,604
Python
import pyopencl as cl def print_device_info() : print('\n' + '=' * 60 + '\nOpenCL Platforms and Devices') for platform in cl.get_platforms(): print('=' * 60) print('Platform - Name: ' + platform.name) print('Platform - Vendor: ' + platform.vendor) print('Platform - Version: ...
42.513514
67
0.527018
[ "MIT" ]
jsdnhk/python-parallel-programming-cookbook-code
Chapter 6/PyOPENCL/PyOpenCLDeviceInfo.py
1,573
Python
''' Borrowed from Asteroid.py and Ship.py which was created by Lukas Peraza url: https://github.com/LBPeraza/Pygame-Asteroids Subzero sprite borrowed from: https://www.spriters-resource.com/playstation/mkmsz/sheet/37161/ ''' import pygame import os from CollegiateObjectFile import CollegiateObject # right in var...
36.684729
178
0.530348
[ "MIT" ]
lbw798/collegiate-combat
CharacterFile.py
14,894
Python
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
33.139535
76
0.597895
[ "MIT" ]
NMijat1024/azure-sdk-for-python
azure-mgmt-eventgrid/azure/mgmt/eventgrid/models/number_not_in_advanced_filter.py
1,425
Python
import os import sys import socket import struct import SocketServer import threadpool # fake ip list FAKE_IPLIST = {} # dns server config TIMEOUT = 2 # set timeout 2 second TRY_TIMES = 5 # try to recv msg times DNS_SERVER = '8.8.8.8' # remote dns server # currently not used def bytetodomain(...
27.796178
78
0.539872
[ "MIT" ]
isayme/DNSFilter
DNSFilter.py
4,364
Python
"""Djinni manager tool""" import os import ezored.functions as fn import ezored.logging as log from ezored import constants as const # ----------------------------------------------------------------------------- def run(params={}): args = params['args'] if len(args) > 0: action = args[0] ...
25.622951
81
0.442099
[ "MIT" ]
uilianries/ezored
files/commands/djinni/djinni.py
1,563
Python
# -*- coding: utf-8 -*- # Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html import pymongo import datetime from scrapy.conf import settings # 学历列表 educations = ("不限","大专","本科","硕士","博士") #修正学历 有些职位中的学历明显...
29.44
84
0.580435
[ "MIT" ]
Annihilater/spider_job
spider/python/tutorial/pipelines.py
3,902
Python
# BSD 2-Clause License # Copyright (c) 2018, Stan Sakl # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright notice, this # list of ...
38.36
80
0.721064
[ "BSD-2-Clause" ]
stansakl/kwic
kwic_python/kwic.py
1,918
Python
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.async_support.base.exchange import Exchange import math from ccxt.base.errors import ExchangeError from ccxt.base.errors import A...
41.087199
225
0.521584
[ "MIT" ]
Abadiq313/ccxt
python/ccxt/async_support/bytetrade.py
44,292
Python
import pytest import numpy as np from ebbef2p.structure import Structure L = 2 E = 1 I = 1 def test_center_load(): P = 100 M_max = P * L / 4 # maximum moment S_max = P/2 # max shearing force w_max = -P * L ** 3 / (48 * E * I) # max displacement tolerance = 1e-6 #set a tolerance of 0.00...
34.509434
102
0.630946
[ "MIT" ]
bteodoru/ebbef2p-python
tests/test_simple supported_beam.py
1,829
Python
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import sys class Hwloc(AutotoolsPackage): """The Hardware Locality (hwloc) software project. The Portable Hardwa...
50.684211
115
0.723572
[ "ECL-2.0", "Apache-2.0", "MIT" ]
CSCfi/spack
var/spack/repos/builtin/packages/hwloc/package.py
4,815
Python
# System Imports import cv2 import json from typing import Optional # Library imports import numpy # Twisted Import from twisted.internet import reactor, defer, threads, protocol from twisted.internet.endpoints import TCP4ClientEndpoint from twisted.internet.interfaces import IAddress # Package Imports from .data im...
29.011834
90
0.598409
[ "MIT" ]
gar-syn/congo-lab
src/octopus/image/source.py
4,903
Python
import numpy as np import logging import unittest import os import scipy.linalg as LA import time from sklearn.utils import safe_sqr, check_array from scipy import stats from pysnptools.snpreader import Bed,Pheno from pysnptools.snpreader import SnpData,SnpReader from pysnptools.kernelreader import KernelNp...
39.667347
274
0.654113
[ "Apache-2.0" ]
HealthML/FaST-LMM
fastlmm/inference/linear_regression.py
19,437
Python
# -*- coding: utf-8 -*- # # Copyright (C) 2019 CERN. # Copyright (C) 2019 Northwestern University. # # Invenio-RDM-Records is free software; you can redistribute it and/or modify # it under the terms of the MIT License; see LICENSE file for more details. """Fake demo records.""" import datetime import json import ran...
32.591603
78
0.469259
[ "MIT" ]
Pineirin/invenio-rdm-records
invenio_rdm_records/fixtures/demo.py
8,539
Python
# Generated by Django 3.2.5 on 2021-07-09 16:58 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('accounts', '0009_auto_20210709_1606'), ] operations = [ migrations.AlterField( model_name='account', name='conf_labe...
41.727273
178
0.607298
[ "MIT" ]
mmohajer9/banker
backend/accounts/migrations/0010_auto_20210709_1658.py
1,836
Python
# -*- coding: utf-8 -*- ############################################################################### # # ListMembers # Retrieves the email addresses of members of a MailChimp list. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); ...
42.823009
219
0.679686
[ "Apache-2.0" ]
jordanemedlock/psychtruths
temboo/Library/MailChimp/ListMembers.py
4,839
Python
#!/usr/bin/env python """ Script which takes one or more file paths and reports on their detected encodings Example:: % chardetect somefile someotherfile somefile: windows-1252 with confidence 0.5 someotherfile: ascii with confidence 1.0 If no paths are provided, it takes its input from stdin. """ # C...
31.696629
98
0.616094
[ "Apache-2.0" ]
fortbox/leetcode-solve
venv/lib/python3.8/site-packages/pip/_vendor/chardet/cli/chardetect.py
2,821
Python
try: from setuptools import setup except: from distutils import setup setup( name="minspan", version="0.1.0", py_modules=["minspan"], install_requires=["cobra"], author="Ali Ebrahim and Aarash Bordbar", author_email="aebrahim@ucsd.edu", url="https://github.com/SBRG/minspan", lic...
24.789474
58
0.613588
[ "MIT" ]
SBRG/minspan
setup.py
471
Python
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import time import math from fair...
26.351515
101
0.596826
[ "BSD-3-Clause" ]
NLP2CT/Meta-Curriculum
fairseq/meters.py
4,348
Python
from flask_wtf import FlaskForm from wtforms import StringField,SubmitField from wtforms.validators import DataRequired class AddTaskForm(FlaskForm): title = StringField('Title', validators=[DataRequired()]) submit = SubmitField('Submit') class DeleteTaskForm(FlaskForm): submit = SubmitField('Delete')
28.818182
61
0.782334
[ "MIT" ]
rkustas/taskmanager
.history/forms_20200723155707.py
317
Python
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ------------------------------------------------------------...
30.448864
79
0.639112
[ "MIT" ]
nrser/qb
dev/scratch/sphinx-quickstart/conf.py
5,359
Python
import os import sys import logging import io from xml.sax.saxutils import escape import template #=============================================================================== #=============================================================================== class _TemplateHandler(object): def __init__(self, pr...
37.797203
80
0.522109
[ "BSD-3-Clause" ]
Parrot-Developers/alchemy
scripts/genproject/eclipse.py
5,405
Python
# Copyright 2014 Hewlett-Packard Development Company, L.P. # # 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 requir...
37.210526
78
0.630363
[ "Apache-2.0" ]
zqfan/python-ceilometerclient
ceilometerclient/tests/v2/test_trait_descriptions.py
2,121
Python
import os import subprocess import sys import shutil import json import argparse import git import getpass import time import platform PKG_ROOT = 'lmctl' PKG_INFO = 'pkg_info.json' DIST_DIR = 'dist' WHL_FORMAT = 'lmctl-{version}-py3-none-any.whl' DOCS_FORMAT = 'lmctl-{version}-docs' DOCS_DIR = 'docs' DOCKER_IMG_TAG = ...
36.770318
148
0.590044
[ "Apache-2.0" ]
IBM/lmctl
build.py
10,406
Python
"""Define AWS storage backends for media files.""" from storages.backends.s3boto3 import S3Boto3Storage def MediaBackend(): """Media storage backend.""" return S3Boto3Storage(location="media")
22.666667
52
0.740196
[ "MIT" ]
florimondmanca/personal-api
aws/backends.py
204
Python
# -*- coding: utf-8 -*- # Generated by Django 1.9.8 on 2017-03-04 14:15 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('talk', '0010_auto_20170304_1500'), ] operations = [ migrations.AlterModelOpt...
30.588235
111
0.589423
[ "BSD-3-Clause" ]
stefanbethke/devday_website
devday/talk/migrations/0011_auto_20170304_1515.py
1,040
Python
#-*- coding: utf-8 -*- """ what : process data, generate batch """ import numpy as np import pickle import random from project_config import * class ProcessDataText: # store data train_set = [] dev_set = [] test_set = [] def __init__(self, data_path): self.data_path = d...
31.865385
93
0.514786
[ "MIT" ]
Ruddy261994/multimodal-speech-emotion
model/process_data_text.py
3,314
Python
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables from...
50.452586
905
0.674071
[ "Apache-2.0" ]
pulumi-bot/pulumi-azure-native
sdk/python/pulumi_azure_native/insights/v20170401/action_group.py
11,705
Python