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
import scipy from manimlib.imports import * from from_3b1b.old.eoc.chapter1 import Thumbnail as Chapter1Thumbnail from from_3b1b.old.eoc.chapter2 import Car, MoveCar, ShowSpeedometer, \ IncrementNumber, GraphCarTrajectory, SecantLineToTangentLine, \ VELOCITY_COLOR, TIME_COLOR, DISTANCE_COLOR def v_rate_func(t)...
30.77982
83
0.536657
[ "MIT" ]
wofeicaoge/manim
from_3b1b/old/eoc/chapter8.py
85,414
Python
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under ...
27.110429
79
0.630686
[ "MIT" ]
Guillaume-Fernandez/PhishInspector
venv/lib/python3.6/site-packages/requests_mock/request.py
4,419
Python
from django.urls import path from meetings.api.views import (MeetingViewset) from rest_framework import routers router = routers.DefaultRouter(trailing_slash='/?') router.register('meetings', MeetingViewset) urlpatterns = router.urls
21.636364
51
0.806723
[ "MIT" ]
MaySoMusician/owaranai-meter
app/meetings/api/urls.py
238
Python
''' Acdfg class will have the class definitions for loading and creating acdfg objects ''' from __future__ import print_function try: from enum import Enum except ImportError: from enum34 import Enum #import proto_acdfg from protobuf.proto_acdfg_pb2 import Acdfg as ProtoAcdfg import logging class NodeType(Enum...
30.705426
97
0.611083
[ "Apache-2.0" ]
LesleyLai/biggroum
python/fixrgraph/annotator/acdfgClass.py
7,922
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 ...
44.103896
209
0.659305
[ "BSD-3-Clause", "BSD-2-Clause", "MIT" ]
EnjoyLifeFund/macSierra-py36-pkgs
azure/mgmt/monitor/models/rule_management_event_data_source.py
3,396
Python
from argparse import Namespace from .simulation_action import Action, SimulationAction from .plot_action import PlotAction from .gram_charlier_action import GramCharlierAction from .cornish_fisher_action import CornishFisherAction from .mc_combination_action import MCCombinationAction from .print_benchmark_action impor...
35.137931
58
0.747792
[ "MIT" ]
daneshvar-amrollahi/polar
cli/actions/factory.py
1,019
Python
import argparse from datetime import datetime from json import decoder from os import path, mkdir, remove from os.path import isfile from threading import Thread from time import sleep try: from progress.bar import Bar import requests import termcolor except ImportError: print("You are missing modules...
32.774359
120
0.560476
[ "MIT" ]
Syrapt0r/PastaScraper
scrape.py
6,391
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) from spack import * class Parsplice(CMakePackage): """ParSplice code implements the Parallel Trajectory Splicing al...
28.882353
105
0.685336
[ "ECL-2.0", "Apache-2.0", "MIT" ]
1nf1n1t3l00p/spack
var/spack/repos/builtin/packages/parsplice/package.py
982
Python
class QuizBrain: def __init__(self, questions): self.question_no = 0 self.score = 0 self.questions = questions self.current_question = None def has_more_questions(self): """To check if the quiz has more questions""" return self.question_no < len(self.qu...
33.315789
85
0.627172
[ "MIT" ]
ashutoshkrris/GUI-Quiz-Tkinter
quiz_brain.py
1,266
Python
from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import render, setup class DefaultTests(SimpleTestCase): """ Literal string arguments to the default filter are always treated as safe strings, regardless of the auto-escaping state. Note: we have to us...
34.9375
96
0.619559
[ "BSD-3-Clause" ]
DasAllFolks/django
tests/template_tests/filter_tests/test_default.py
1,677
Python
"""General-purpose training script for image-to-image translation. This script works for various models (with option '--model': e.g., pix2pix, cyclegan, colorization) and different datasets (with option '--dataset_mode': e.g., aligned, unaligned, single, colorization). You need to specify the dataset ('--dataroot'), e...
59.423913
180
0.690324
[ "MIT" ]
supri-a/TXM2SEM
train.py
5,467
Python
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from argparse import Namespace import contextlib import copy import math import numpy as np import torch import torch.nn as nn import torch.nn...
34.521886
90
0.631913
[ "MIT" ]
227514/Supervised-Simultaneous-MT
fairseq/models/wav2vec/wav2vec2_asr.py
20,506
Python
""" Django settings for webappexample project. Generated by 'django-admin startproject' using Django 1.11.4. For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ fro...
26.096774
91
0.710507
[ "MIT" ]
alexisluque/auth0-django-web-app
01-Login/webappexample/settings.py
4,045
Python
""" Author: thangbk2209 Project: Autoscaling Created: 3/15/19 16:48 Purpose: """ import random import os import matplotlib import matplotlib.pyplot as plt from sklearn.preprocessing import MinMaxScaler, StandardScaler import tensorflow as tf from config import * def draw_time_series(data, title, x_label, ...
26.244755
80
0.656541
[ "MIT" ]
vutriancode/mfea_autoscaling
lib/includes/utility.py
3,753
Python
# -*- coding: utf-8 -*- # Copyright (c) Facebook, Inc. and its affiliates. import functools import inspect import logging from fvcore.common.config import CfgNode as _CfgNode from detectron2.utils.file_io import PathManager class CfgNode(_CfgNode): """ The same as `fvcore.common.config.CfgNode`, but differe...
35.019455
98
0.62
[ "Apache-2.0" ]
873900204/datasets
detectron2/config/config.py
9,000
Python
#!/usr/bin/env python3 """ This script builds the ASKE deliverable reports as PDFs by combining the markdown files, using pandoc. Usage: ./build_report.py <report_name> """ import os, sys from glob import glob import subprocess as sp def transform_line(line): # Transform headers - numbered headings are not ...
27.564103
76
0.583256
[ "Apache-2.0" ]
mikiec84/automates
documentation/deliverable_reports/build_report.py
2,150
Python
# # PySNMP MIB module Juniper-MPLS-CONF (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Juniper-MPLS-CONF # Produced by pysmi-0.3.4 at Wed May 1 14:03:27 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Ma...
120.918033
477
0.759219
[ "Apache-2.0" ]
agustinhenze/mibs.snmplabs.com
pysnmp-with-texts/Juniper-MPLS-CONF.py
7,376
Python
# -*- coding:utf-8; python-indent:2; indent-tabs-mode:nil -*- # Copyright 2013 Google Inc. 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/...
33.007563
80
0.675705
[ "Apache-2.0" ]
Jason-Cooke/pytype
pytype/pytd/optimize.py
39,279
Python
""" --- Ångström --- Read, manipulate and analyze molecular trajectory files. """ from .read import read_xyz_traj from .write import write_xyz_traj from angstrom.geometry import get_molecule_center from angstrom import Molecule import numpy as np import os class Trajectory: """ Reading and analyzing trajector...
28.542289
105
0.56092
[ "BSD-3-Clause" ]
kbsezginel/angstrom
angstrom/trajectory/trajectory.py
5,739
Python
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE from __future__ import absolute_import import sys import numpy import awkward as ak def convert_to_array(layout, args, kwargs): out = ak.operations.convert.to_numpy(layout, allow_missing=False) if args == () and kwargs...
32.475059
88
0.557636
[ "BSD-3-Clause" ]
drahnreb/awkward-1.0
src/awkward/_connect/_numpy.py
13,672
Python
from Crypto.Cipher import AES from Crypto.Protocol.KDF import PBKDF2 import base64 import gzip import hashlib import hmac import json import os import requests import secrets import sys import uuid APP_NAME = "com.amazon.avod.thirdpartyclient" APP_VERSION = "296016847" DEVICE_NAME = "walleye/google/Pixel 2" MANUFACTU...
31.578616
128
0.601872
[ "MIT" ]
Sapphicality/comix
amazon_auth.py
5,021
Python
# Generated by Django 3.0.4 on 2020-03-26 03:39 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('ViralScreener', '0008_auto_20200326_0338'), ] operations = [ migrations.AlterField( model_name='employeescreeningresponses', ...
21.315789
53
0.619753
[ "MIT" ]
memtech3/Viral-Screener
mysite/ViralScreener/migrations/0009_auto_20200326_0339.py
405
Python
# Crie um programa onde o usuário possa digitar sete valores numéricos # e cadastre-os em uma lista única que mantenha separados os valores pares e ímpares. # No final, mostre os valores pares e ímpares em ordem crescente. lista_unic = [[], []] print('-=' * 20) for c in range(0, 7): nums = int(input(f'Informe um {c...
34.222222
85
0.662338
[ "MIT" ]
GustavoVieiraa/CursoemVideo---Python-3
CursoemVideo - Python 3/aula 18/ex085.py
623
Python
# Generated by Django 3.2.4 on 2021-06-05 20:41 import django.contrib.auth.models import django.contrib.auth.validators from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0012_alter_user_first_name_m...
63.977778
329
0.664467
[ "MIT" ]
aleattene/django-for-professionals
accounts/migrations/0001_initial.py
2,879
Python
import numpy as np import pytest import xarray as xr import cf_xarray as cfxr from . import requires_shapely @pytest.fixture def geometry_ds(): from shapely.geometry import MultiPoint, Point # empty/fill workaround to avoid numpy deprecation(warning) due to the array interface of shapely geometries. ge...
32.100629
113
0.631074
[ "Apache-2.0" ]
dcherian/cf-xarray
cf_xarray/tests/test_geometry.py
5,104
Python
""" list of movies that feed into fresh_tomatoes.py file """ import fresh_tomatoes from get_movie_list import get_movie_list def main(): """ Main entry point for the script. """ # Read in the movies from the json file movie_list = get_movie_list("src/data/movies.json") # Generate the html ...
22.944444
60
0.714286
[ "MIT" ]
golgistudio/udacity-movie-trailer
src/entertainment_center.py
413
Python
from bson.objectid import ObjectId from faker import Faker from flask import url_for from dawdle import create_app from dawdle.models.board import Board, BoardType from dawdle.models.user import User class TestBase: @classmethod def setup_class(cls): cls.fake = Faker() cls.app = create_app(...
29.428571
76
0.612024
[ "MIT" ]
simba999/dawdle
tests/test_base.py
2,678
Python
import pandas as pd import numpy as np import itertools as it from collections import defaultdict from collections import Counter from six.moves import map as imap def dict_subset(d, fields): # return a subset of the provided dict containing only the # fields specified in fields return {k: d[k] for k in d...
29.954887
85
0.592369
[ "Apache-2.0" ]
GlobalFishingWatch/pipe-segment
pipe_segment/stats/stats.py
3,984
Python
"""[Lambda Expressions] Lambda expressions are simply another way to create functions anonymous functions keyword \ parameter list optional \ \ the : is required, even for zero arguments \ \ / / this expression is evaluated and returned when the lamb...
19.966102
161
0.633277
[ "Unlicense" ]
minefarmer/deep-Dive-1
.history/my_classes/FirstClassFunctions/LambdaExpressions_20210704152007.py
1,178
Python
import json from flask import Flask, request, Response, send_from_directory, redirect, flash from flask_login import LoginManager, current_user, login_user from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, BooleanField, SubmitField from wtforms.validators import DataRequired from ..models ...
31.727273
80
0.698185
[ "MIT" ]
Arianardo/augur-group25
augur/routes/user.py
1,047
Python
""" Distance and Area objects to allow for sensible and convenient calculation and conversions. Here are some tests. """ import unittest from djmodels.contrib.gis.measure import A, Area, D, Distance class DistanceTest(unittest.TestCase): "Testing the Distance object" def testInit(self): "Testing in...
26.204225
105
0.555496
[ "BSD-3-Clause" ]
iMerica/dj-models
tests/gis_tests/test_measure.py
7,442
Python
import keras import numpy as np from keras.datasets import mnist (x_train,y_train),(x_test,y_test)=mnist.load_data() x_train = x_train.reshape(60000,784) x_test = x_test.reshape(10000,784) x_train = x_train/255.0 x_test = x_test/255.0 from keras.utils import to_categorical y_train = to_categorical(y_trai...
29.488889
85
0.747551
[ "MIT" ]
Aadesh-1404/Deep-Neural-Networks-Model---Keras-Tensorflow-
MNIST dataset - FCNN/FCNN.py
1,327
Python
import _plotly_utils.basevalidators class ColorValidator(_plotly_utils.basevalidators.ColorValidator): def __init__( self, plotly_name="color", parent_name="choroplethmapbox.hoverlabel.font", **kwargs ): super(ColorValidator, self).__init__( plotly_name=plot...
27.944444
66
0.620278
[ "MIT" ]
1abner1/plotly.py
packages/python/plotly/plotly/validators/choroplethmapbox/hoverlabel/font/_color.py
503
Python
# console converter - USD to BGN # Write a program for converting US dollars (USD) into Bulgarian levs (BGN). # Round the result to 2 digits after the decimal point. Use a fixed exchange rate between the dollar and the lev: 1 USD = 1.79549 BGN. USD = float(input()) BGN = round(USD * 1.79549, 2) print(BGN)
38.5
134
0.724026
[ "MIT" ]
karolinanikolova/SoftUni-Software-Engineering
1-Python-Programming-Basics (Sep 2020)/Course-Exercises-and-Exams/01_First-Steps-in-Coding/00.Book-Exercise-2.1-11-USD-to-BGN.py
308
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 may ...
49.472
105
0.747413
[ "MIT" ]
Caoxuyang/azure-cli-extensions
src/desktopvirtualization/azext_desktopvirtualization/vendored_sdks/desktopvirtualization/_desktop_virtualization_api_client.py
6,184
Python
#!/usr/bin/env 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 "Li...
48.515564
275
0.685447
[ "Apache-2.0" ]
SharaWeil/kafka-0.11.0
release.py
24,937
Python
from masonite.foundation import response_handler from masonite.storage import StorageCapsule from masonite.auth import Sign from masonite.environment import LoadEnvironment from masonite.utils.structures import load from masonite.utils.location import base_path from masonite.middleware import ( SessionMiddleware, ...
37.990741
96
0.700219
[ "MIT" ]
MasoniteFramework/masonite-packages
Kernel.py
4,103
Python
import html import os import pathlib import shutil import sqlite3 import sys from collections import OrderedDict from scripts.html_parts import * from scripts.ilapfuncs import logfunc from scripts.version_info import aleapp_version, aleapp_contributors def get_icon_name(category, artifact): ''' Returns the icon ...
37.477528
139
0.578574
[ "MIT" ]
theAtropos4n6/iLEAPP
scripts/report.py
20,013
Python
import unittest from realm.cli.application import Application from realm.cli.commands.install import InstallCommand from realm.cli.commands.ls import LsCommand from realm.cli.commands.task import TaskCommand from realm.entities import Config, RealmContext from realm.utils.child_process import ChildProcess from tests....
33.5
94
0.617021
[ "MIT" ]
orlevii/realm
tests/test_multiple_packages_with_tasks.py
3,149
Python
#! /usr/bin/env 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 # "...
33.08
74
0.724305
[ "Apache-2.0" ]
Albertsss/hue
desktop/core/ext-py/avro-1.7.6/setup.py
1,654
Python
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from .core import *
16.75
23
0.597015
[ "MIT" ]
IlyaDanilenko/kiberdrom_core
kiberdrom_core/controller/__init__.py
67
Python
from django import template from django.utils.safestring import mark_safe import markdown from markdownx.utils import markdownify from markdownx.settings import ( MARKDOWNX_MARKDOWN_EXTENSIONS, MARKDOWNX_MARKDOWN_EXTENSION_CONFIGS ) from markdown.extensions import Extension register = template.Library() @reg...
25.15
63
0.762425
[ "MIT" ]
whitecat-22/blog_site
blog/templatetags/markdown_html.py
1,180
Python
import numpy as np from bayes_implicit_solvent.continuous_parameter_experiments.elemental_types_mh import log_prior, mols, ll, data_path, \ smiles smiles_list = smiles from bayes_implicit_solvent.typers import RADIUS_UNIT from bayes_implicit_solvent.freesolv import smiles_list from bayes_implicit_solvent.typers ...
34.764045
128
0.723659
[ "MIT" ]
openforcefield/bayes-implicit-solvent
bayes_implicit_solvent/rjmc_experiments/tree_rjmc2.py
3,094
Python
from __future__ import absolute_import from __future__ import division from __future__ import print_function import logging from ray.rllib.agents import Agent, with_common_config from ray.rllib.agents.ppo.ppo_policy_graph import PPOPolicyGraph from ray.rllib.optimizers import SyncSamplesOptimizer, LocalMultiGPUOptimi...
42.410405
79
0.622189
[ "Apache-2.0" ]
FieldMrFive/ray
python/ray/rllib/agents/ppo/ppo.py
7,337
Python
import re from itertools import chain from django.core.exceptions import FieldError from django.db.models.constants import LOOKUP_SEP from django.db.models.expressions import OrderBy, Random, RawSQL, Ref from django.db.models.query_utils import QueryWrapper, select_related_descend from django.db.models.sql.constants i...
43.823339
106
0.585414
[ "BSD-3-Clause" ]
hottwaj/django
django/db/models/sql/compiler.py
54,078
Python
import numpy as np import matplotlib.pyplot as plt from matplotlib.image import imread # 데이터 준비 x = np.arange(0, 6, 0.1) # 0에서 6까지 0.1 간격으로 생성 y1 = np.sin(x) y2 = np.cos(x) # 그래프 그리기 plt.plot(x, y1, label='sin') plt.plot(x, y2, linestyle='--', label='cos') # cos 함수는 점선으로 그리기 plt.xlabel('x') # x축 이름 plt.ylabel('y')...
20.904762
64
0.646925
[ "MIT" ]
Tim232/Python-Things
Books/DeepLearningfromScratch/P01_HelloPython/numpy_pyplot.py
527
Python
import torch import torch.nn.functional as F import torch_glow from collections import namedtuple from tests.utils import jitVsGlow # Basic test of the PyTorch conv2d Node on Glow. def test_conv2d_basic(): def conv2d_basic(inputs, filters): conv = F.conv2d(inputs, filters, padding=1) return F.relu(...
29.909091
163
0.677204
[ "Apache-2.0" ]
a1f/glow
torch_glow/tests/nodes/conv2d_test.py
1,645
Python
import argparse import sys import pathlib import random from unittest import mock import pytest from _repobee import plugin import repobee_plug as plug from repobee_feedback import feedback ASSIGNMENT_NAMES = ("task-1", "task-2") STUDENT_TEAMS = tuple( [ plug.StudentTeam(members=members) for memb...
33.548673
79
0.684648
[ "MIT" ]
slarse/repobee-feedback
tests/test_feedback.py
7,582
Python
import tkinter key= "" def key_down(e): global key key = e.keysym def key_up(e): global key key = "" mx, my = (1, 1) def main_proc(): global mx, my if key == "Up" and maze[my-1][mx] == 0: my -= 1 if key == "Down" and maze[my+1][mx] == 0: my += 1 if key == "Left" and ...
22.839286
102
0.503518
[ "MIT" ]
rrbb014/rrbb-playground
python/game/gui/maze.py
1,293
Python
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modif...
43.584416
100
0.65003
[ "Apache-2.0" ]
Cristian-Malinescu/qiskit-aqua
qiskit/optimization/algorithms/recursive_minimum_eigen_optimizer.py
13,424
Python
import mechanize from DictUtils import listToDict from Scraper import Scraper import pprint prettyPrinter = pprint.PrettyPrinter(indent=4, width=50) class HeadlessScraper(): def __init__(self, username): self.browser = mechanize.Browser() self.browser.set_handle_robots(False) self.baseUr...
30.95
102
0.62951
[ "MIT" ]
ransomwarezz/instagram-scraper
core/HeadlessScraper.py
1,857
Python
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Base class for a stock configuration. @author: rajsaswa """ class StockConfig: def __init__(self): pass def get_stock_url(self): pass
14.666667
37
0.590909
[ "MIT" ]
saswatraj/stock_notifier
stock_notifier/stock_config/stock_config.py
220
Python
import warnings import pandas as pd from ..config import Config from ..backend import Backend from ..backend import PYOORB from ..backend import FINDORB from ..backend import MJOLNIR __all__ = [ "generateEphemeris" ] def generateEphemeris( orbits, observers, backend="MJOLNIR", b...
31.103448
123
0.645233
[ "BSD-3-Clause" ]
B612-Asteroid-Institute/thor
thor/orbits/ephemeris.py
2,706
Python
import pytest from tickit.devices.eiger.eiger_status import EigerStatus # # # # # EigerStatus Tests # # # # # @pytest.fixture def eiger_status() -> EigerStatus: return EigerStatus() def test_eiger_status_constructor(): EigerStatus() def test_eiger_status_getitem(eiger_status): assert 24.5 == eiger_s...
17.789474
57
0.730769
[ "Apache-2.0" ]
dls-controls/tickit
tests/devices/eiger/test_eiger_status.py
338
Python
from DockerBuildSystem import DockerComposeTools, YamlTools, TerminalTools from SwarmManagement import SwarmTools from DockerBuildManagement import BuildTools import sys import os BUILD_KEY = 'build' SAVE_IMAGES_KEY = 'saveImages' def GetInfoMsg(): infoMsg = "Build selections is configured by adding a 'build' pr...
39.768421
105
0.754367
[ "MIT" ]
DIPSAS/DockerBuildManagement
DockerBuildManagement/BuildSelections.py
3,778
Python
from typing import Dict, List, Any from checkov.common.models.enums import CheckCategories, CheckResult from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceCheck class S3BucketObjectLock(BaseResourceCheck): def __init__(self) -> None: name = "Ensure that S3 bucket has lock...
38.533333
106
0.712803
[ "Apache-2.0" ]
0xflotus/checkov
checkov/terraform/checks/resource/aws/S3BucketObjectLock.py
1,156
Python
#! -*- coding:utf-8 -*- # 评估脚本 # 数据集:IFLYTEK' 长文本分类 (https://github.com/CLUEbenchmark/CLUE) import json import numpy as np from bert4keras.backend import keras, set_gelu from bert4keras.tokenizers import Tokenizer from bert4keras.models import build_transformer_model from bert4keras.optimizers import Adam from bert4ke...
31.719424
84
0.701066
[ "Apache-2.0" ]
CurisZhou/pretrained-models
examples/task_iflytek.py
4,497
Python
# Athena Health Preliminary Test - II #!/bin/python3 import math import os import random import re import sys # # Complete the 'moves' function below. # # The function is expected to return an INTEGER. # The function accepts INTEGER_ARRAY arr as parameter. # def moves(arr): ee=e=0 for i in range(0,len(arr)...
17.651163
54
0.598155
[ "MIT" ]
allenalvin333/Hackerrank_Interview
0_Companies/ATHENA2.py
759
Python
from tests.test_utils.test_logger import TestLogger from tests.test_utils.test_models import TestClassicalModel from tests.test_utils.test_utils import TestUtils
40.5
59
0.888889
[ "MIT" ]
Darshan-ko/genrl
tests/test_utils/__init__.py
162
Python
import os import requests from os.path import join, isfile from nerblackbox.modules.datasets.formatter.base_formatter import BaseFormatter class CoNLL2003Formatter(BaseFormatter): def __init__(self): ner_dataset = "conll2003" ner_tag_list = ["PER", "ORG", "LOC", "MISC"] super().__init__(n...
35.472222
120
0.456017
[ "Apache-2.0" ]
af-ai-center/nerblackbox
nerblackbox/modules/datasets/formatter/conll2003_formatter.py
3,832
Python
# Copyright 2013-2022 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 os from spack.package import * class Visit(CMakePackage): """VisIt is an Open Source, interactive, scalable,...
35.494083
142
0.562474
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
jmellorcrummey/spack
var/spack/repos/builtin/packages/visit/package.py
11,997
Python
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('data', '0002_auto_20141114_1935'), ] operations = [ migrations.RemoveField( model_name='registryentry', ...
23.064516
44
0.569231
[ "Apache-2.0" ]
APTrust/EarthDiver
dpnode/dpn/data/migrations/0003_auto_20141117_2011.py
715
Python
import math import numpy as np from enum import IntEnum class Mode(IntEnum): CUSTOM = 0 EQUAL = 1 GAUSS = 2 GAUSS_SYM = 3 PYRAMID = 4 PYRAMID_SYM = 5 SIVEROO_1 = 6 SIVEROO_2 = 7 #This function will return an list of value, like...
27.968421
96
0.515995
[ "MIT" ]
FireRedz/HFR-Resampler
weights.py
2,657
Python
#!/usr/bin/env python from setuptools import setup setup( name='mobib', version='0.1', description='Retrieve remaining number of trips from your MOBIB Basic', author='Bruno Parmentier', author_email='dev@brunoparmentier.be', url='https://github.com/bparmentier/mobib-reader/', py_modules=['...
24.444444
75
0.665909
[ "MIT" ]
bparmentier/mobib-basic-reader
setup.py
440
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...
31.040816
74
0.753123
[ "Apache-2.0" ]
ankitdobhal/aliyun-openapi-python-sdk
aliyun-python-sdk-iot/aliyunsdkiot/request/v20180120/CreateRuleRequest.py
3,042
Python
import tweepy from time import sleep from datetime import datetime from keys import * from tqdm import tqdm def play(test=True,i_pages=3, i_hashtag=20, like_pages=False, like_hashtag=False): while True == True: try: econotwbot(test, i_pages, i_hashtag) except Exception a...
34.038462
101
0.54096
[ "MIT" ]
ppnasser/econotw
econotw.py
3,540
Python
#!/usr/bin/env python3 import uuid import random import datetime from faker import Factory fake = Factory.create() num_people = 1000 last_jump_start = datetime.datetime(2008, 9, 1) last_jump_end = datetime.datetime(2016, 8, 1) print('COPY members (uuid, name, email, phone_number, last_jump, created_at, updated_at) ...
36.137931
145
0.733779
[ "MIT" ]
colorshifter/lsd-members
test-data/members.py
1,048
Python
import os from selfdrive.manager.process import PythonProcess, NativeProcess, DaemonProcess from selfdrive.hardware import EON, TICI, PC from common.op_params import opParams WEBCAM = os.getenv("USE_WEBCAM") is not None procs = [ DaemonProcess("manage_athenad", "selfdrive.athena.manage_athenad", "AthenadPid"), #...
60.866667
127
0.741512
[ "MIT" ]
SebastienLubrano/openpilot
selfdrive/manager/process_config.py
2,739
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- # ======================================= # File Name: test_ADMM.py # Purpose : test ADMM solver for primal # problem and dual problem # ======================================= from utils import get_params from ADMM_primal import ADMM_primal from ADMM_dual impo...
29.915254
116
0.5983
[ "MIT" ]
CrazyIvanPro/Optimal_Transport
test_ADMM.py
1,765
Python
# -*- coding: utf-8 -*- """ solutions_by_text.sbt_token_generator ~~~~~~~~~~~~ This module handles security token generation. """ # @Author: sijanonly # @Date: 2018-03-19 10:57:26 # @Last Modified by: sijanonly # @Last Modified time: 2018-03-19 14:51:07 import json from urllib import parse import requests from...
25.103448
74
0.666896
[ "MIT" ]
sijanonly/sbt-python-client
solutions_by_text/sbt_token_generator.py
1,456
Python
n = [] v = int(input()) n.append([v*x*2 for x in range(1,11)]) print(n) for i in range(len(n)): print('N[%d] = %d' % (i, n[i]))
18.857143
38
0.5
[ "MIT" ]
pedrodanieljardim/Desafios-URI-feitos-em-java
Beginner/1173.py
132
Python
from curielogserver import app, get_default_dbconfig import os import time import psycopg2.pool from psycopg2 import OperationalError retries = 10 while retries > 0: retries -= 1 try: app.config['postgreSQL_pool'] = psycopg2.pool.ThreadedConnectionPool(1, 20, get_default_dbconfig()) break e...
24.058824
107
0.691932
[ "Apache-2.0" ]
bochuxt/curiefense
curiefense/curielogserver/app/main.py
409
Python
# -*- coding: utf-8 -*- """ TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-权限中心(BlueKing-IAM) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with th...
50.631579
115
0.754678
[ "MIT" ]
Canway-shiisa/bk-iam-saas
saas/backend/debug/urls.py
978
Python
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Youngseokcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the abandontransaction RPC. The abandontransaction RPC marks a transaction and all its in-...
48.628931
137
0.662442
[ "MIT" ]
youngseoka/youngseokcoin
test/functional/abandonconflict.py
7,732
Python
from django.shortcuts import render def landing_page(request): return render(request,'landing_page.html',)
23.2
48
0.758621
[ "MIT" ]
yosif88/SoftUni
python-web/petstagram/petstagram/common/views.py
116
Python
#You can either add the python package path. #sys.path.append(r'/mnt/e/GitHub_Design/Metalprot') from metalprot.search import search_selfcenter from metalprot.basic import filter import pickle import time import prody as pr ''' python /mnt/e/GitHub_Design/Metalprot/scrips/search_selfcenter/run_selfcenter_search.py ''...
30.555556
134
0.687552
[ "MIT" ]
lonelu/Metalprot
scrips/search_selfcenter/run_selfcenter_search.py
3,575
Python
# coding=utf-8 import logging import pytest from rasa_nlu.evaluate import ( is_token_within_entity, do_entities_overlap, merge_labels, remove_duckling_entities, remove_empty_intent_examples, get_entity_extractors, get_duckling_dimensions, known_duckling_dimensions, find_component, remove_duckling...
31.982368
80
0.595259
[ "Apache-2.0" ]
careless25/rasa_nlu
tests/base/test_evaluation.py
12,735
Python
# coding: utf-8 """ OpenAPI Petstore This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 The version of the OpenAPI document: 1.0.0 Generated by: https://openapi-generator.tech """ ...
27.155172
174
0.674921
[ "Apache-2.0" ]
0x0c/openapi-generator
samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/test/test_child.py
1,575
Python
# Copyright 2020 MONAI Consortium # 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, s...
42.72093
111
0.679096
[ "Apache-2.0" ]
BRAINSia/MONAI
monai/handlers/checkpoint_loader.py
3,676
Python
#pip install flask-bcrypt from flask_bcrypt import Bcrypt # Create the Hasher bcrypt = Bcrypt() hashed_pass = bcrypt.generate_password_hash('somethingSuperSecret') print(hashed_pass) wrong_check = bcrypt.check_password_hash(hashed_pass, 'wrongpass') print(wrong_check) right_check = bcrypt.check_password_hash(hashed...
24.666667
77
0.827027
[ "Apache-2.0" ]
saidulislam/flask-bootcamp-1
07-User-Authentication/00-Password-Hashing/Using-Bcrypt.py
370
Python
_k = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988...
28.974359
60
0.553097
[ "MIT" ]
ryos36/polyphony-tutorial
sha2/py_sha256.py
2,260
Python
#!/usr/bin/env python3 # =============================================================================== # NAME: XmlSerializeParser.py # # DESCRIPTION: This class parses the XML serializable types files. # # USAGE: # # AUTHOR: reder # EMAIL: reder@jpl.nasa.gov # DATE CREATED : June 4, 2013 # # Copyright 2013, Califo...
34.324324
103
0.500197
[ "Apache-2.0" ]
1Blackdiamondsc/fprime
Autocoders/Python/src/fprime_ac/parsers/XmlSerializeParser.py
10,160
Python
from .core import Pool, CatboostError, get_catboost_bin_module, ARRAY_TYPES from collections import defaultdict import numpy as np _catboost = get_catboost_bin_module() _eval_metric_util = _catboost._eval_metric_util _get_roc_curve = _catboost._get_roc_curve _select_threshold = _catboost._select_threshold def create...
35.939163
111
0.632988
[ "Apache-2.0" ]
infected-mushroom/catboost
catboost/python-package/catboost/utils.py
9,452
Python
"""Top-level package for Tinned Python.""" __author__ = """Tom Finill""" __email__ = 'tomfinill@gmail.com' __version__ = '0.1.0'
21.666667
42
0.684615
[ "MIT" ]
tmfnll/tinned_python
tinned_python/__init__.py
130
Python
""" Example code that implements a simple Neural Net predictor for z_mode, and Gaussian centered at z_mode with base_width read in fromfile and pdf width set to base_width*(1+zmode). """ import numpy as np # from numpy import inf import sklearn.neural_network as sknn from sklearn.preprocessing import StandardScaler fr...
33.94
74
0.61756
[ "MIT" ]
pwhatfield/RAIL
rail/estimation/algos/sklearn_nn.py
3,394
Python
import os PROJECT_PATH = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) SOURCE_DIR_PATH = os.path.join(PROJECT_PATH, 'doc', 'source', 'markdown_files')
41.25
79
0.769697
[ "MIT" ]
williamfzc/md2doc
md2doc/utils/static.py
165
Python
# problem 37 # Project Euler __author__ = 'Libao Jin' __date__ = 'July 17, 2015' def rotateDigits(number): string = str(number) rotatedString = string[::-1] rotatedNumber = int(rotatedString) return rotatedNumber def isSymmetrical(number): rotatedNumber = rotateDigits(number) if rotatedNumber == number: ret...
19.057692
46
0.726539
[ "MIT" ]
imthomasking/MATLAB-files
Python/Project.Euler/Answers.Python/36.py
991
Python
""" Django settings for testapp project. Generated by 'django-admin startproject' using Django 1.10.6. For more information on this file, see https://docs.djangoproject.com/en/1.10/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.10/ref/settings/ """ import os...
25.375758
91
0.666826
[ "MIT" ]
felocru/django-map-widgets
tests/testapp/testapp/settings.py
4,187
Python
########################################################################## # # Copyright (c) 2017, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistribu...
43.738255
189
0.709069
[ "BSD-3-Clause" ]
carlosg-ie/cortex
test/IECoreScene/MeshAlgoWindingTest.py
6,517
Python
from sqlalchemy.sql import func as fn from sqlalchemy import sql from ..translate import ( SqlTranslator, extend_base, sql_scalar, sql_agg, win_agg, win_cumul, annotate ) #from .postgresql import PostgresqlColumn, PostgresqlColumnAgg from .base import SqlColumn, SqlColumnAgg from . import ...
27.034884
122
0.653333
[ "MIT" ]
Techzune/siuba
siuba/sql/dialects/snowflake.py
2,325
Python
from __future__ import unicode_literals from __future__ import absolute_import if False: from typing import Type import six from smoke_tests.tools.compat import Path from smoke_tests.tools.package.base_builder import AgentImageBuilder AMAZONLINUX = "amazonlinux" UBUNTU = "ubuntu" ALL_DISTRIBUTION_NAMES = [AMA...
35.566265
95
0.679878
[ "Apache-2.0" ]
zak905/scalyr-agent-2
smoke_tests/tools/package/__init__.py
2,952
Python
import csv import sys from pathlib import Path sys.path.append(str(Path(__file__).resolve().parent.parent)) from skimage.color import rgb2gray import numpy as np from tqdm import tqdm from tadataka import VisualOdometry, CameraParameters from tadataka.rigid import exp_se3, log_se3 from tadataka.projection import war...
29.47619
82
0.668498
[ "Apache-2.0" ]
IshitaTakeshi/DVO
examples/rgbd_desk.py
3,095
Python
from datetime import date ano_nascimento = int(input('Digite o ano de nascimento:')) ano_atual = date.today().year idade = abs(ano_nascimento - ano_atual) falta1 = (18 - idade) falta2 = (idade - 18) if idade < 18: print('Ainda vai se alistar , faltam {} anos'.format(abs(falta1))) ano = falta1 + ano_atua...
31.15
75
0.654896
[ "Apache-2.0" ]
thaisouza30/Exercicios-Python3-Curso-em-Video
ex039.py
626
Python
DEPS = [ 'archive', 'chromium', 'chromium_android', 'depot_tools/bot_update', 'depot_tools/gclient', 'depot_tools/tryserver', 'file', 'recipe_engine/path', 'recipe_engine/platform', 'recipe_engine/properties', 'recipe_engine/python', 'recipe_engine/step', 'trigger', ] # TODO(phajdan.jr): pro...
19.6
63
0.701531
[ "BSD-3-Clause" ]
bopopescu/chromium-build
scripts/slave/recipe_modules/libyuv/__init__.py
392
Python
from PIL import Image import numpy from random import randint """ A plugin used to create a set of variable spefications for permutation groups. """ def transform(img,source,target,**kwargs): cv_image = numpy.array(img) shape = cv_image.shape snapto8 = 'eightbit_boundary' in kwargs and kwargs['eightbit_b...
48.22
115
0.608461
[ "BSD-3-Clause" ]
spongezhang/maskgen
plugins/CropPermutations/__init__.py
2,411
Python
# -*- coding: utf-8 -*- # Copyright 2017-2018 ICON Foundation # # 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 ...
41.645161
154
0.731603
[ "Apache-2.0" ]
Transcranial-Solutions/t-bears
tests/test_prep_manager.py
2,582
Python
# Python function to manipulate OpenFOAM files # Developer: Jian-Xun Wang (jwang33@nd.edu) ############################################################################### # system import import numpy as np import numpy.matlib import sys # Add extra path/directory import os import os.path as ospt import shutil import ...
27.205479
122
0.542296
[ "MIT" ]
Jianxun-Wang/PICNNSR
demo0/foamFileOperation.py
3,972
Python
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test mempool limiting together/eviction with the wallet.""" from test_framework.test_framework import ...
42.148936
118
0.664816
[ "MIT" ]
BlenderSleuth/schleems
test/functional/mempool_limit.py
1,981
Python
import numpy as np def evaluate(X: np.ndarray, A: float = 7.0, B: float = 0.1) -> np.ndarray: """Non-monotonic Ishigami-Homma three parameter test function: `f(x) = \sin(x_{1}) + A \sin(x_{2})^2 + Bx^{4}_{3}\sin(x_{1})` This test function is commonly used to benchmark global sensitivity me...
31.457627
79
0.566272
[ "MIT" ]
QianWanghhu/SALib
src/SALib/test_functions/Ishigami.py
1,856
Python
# Copyright 2019 Huawei Technologies Co., Ltd # # 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...
43.680556
102
0.683625
[ "Apache-2.0" ]
Gavin-Hoang/mindspore
tests/st/ops/gpu/test_resize_nearest_neighbor_op.py
3,145
Python