hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a178d9822d44fe68b3a8836efbf3b25c80a8933d | 1,622 | py | Python | acme_report.py | echiyembekeza/lambdata-echiyembekeza | 5863ce35f04b2f7c904e46dc0dc33504ba331f1c | [
"MIT"
] | null | null | null | acme_report.py | echiyembekeza/lambdata-echiyembekeza | 5863ce35f04b2f7c904e46dc0dc33504ba331f1c | [
"MIT"
] | null | null | null | acme_report.py | echiyembekeza/lambdata-echiyembekeza | 5863ce35f04b2f7c904e46dc0dc33504ba331f1c | [
"MIT"
] | null | null | null | """Utilities to make and report data on Acme products."""
from random import randint, sample, uniform
from acme import Product
ADJECTIVES = ['Awesome', 'Shiny', 'Impressive', 'Portable', 'Improved']
NOUNS = ['Anvil', 'Catapult', 'Disguise', 'Mousetrap', '???']
def generate_products(num_products=30):
"""Making ... | 34.510638 | 79 | 0.654131 |
de38a986ceea8e8b3285aaa8876a1d704cef39dd | 299 | py | Python | python/ql/test/library-tests/ControlFlow/ssa/phi-nodes/test2.py | vadi2/codeql | a806a4f08696d241ab295a286999251b56a6860c | [
"MIT"
] | 4,036 | 2020-04-29T00:09:57.000Z | 2022-03-31T14:16:38.000Z | python/ql/test/library-tests/ControlFlow/ssa/phi-nodes/test2.py | vadi2/codeql | a806a4f08696d241ab295a286999251b56a6860c | [
"MIT"
] | 2,970 | 2020-04-28T17:24:18.000Z | 2022-03-31T22:40:46.000Z | python/ql/test/library-tests/ControlFlow/ssa/phi-nodes/test2.py | ScriptBox99/github-codeql | 2ecf0d3264db8fb4904b2056964da469372a235c | [
"MIT"
] | 794 | 2020-04-29T00:28:25.000Z | 2022-03-30T08:21:46.000Z | #Weird formatting is so that all uses and defn are on separate lines
#to assist checking test results.
def with_phi(
cond):
if cond:
l0 = 0
else:
l0 = 1
return l0
def with_phi2(
cond):
l1 = 0
if cond:
pass
else:
l1 = 1
return l1
| 14.95 | 68 | 0.551839 |
947fa0713be3e584900f2fbfb0fa6ed340c606ee | 4,071 | py | Python | app/recipe/tests/test_tags_api.py | Irfan995/recipe-app-api | a276e2526205b28439dbb023c87adabd5fc76a86 | [
"MIT"
] | null | null | null | app/recipe/tests/test_tags_api.py | Irfan995/recipe-app-api | a276e2526205b28439dbb023c87adabd5fc76a86 | [
"MIT"
] | null | null | null | app/recipe/tests/test_tags_api.py | Irfan995/recipe-app-api | a276e2526205b28439dbb023c87adabd5fc76a86 | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
from django.urls import reverse
from django.test import TestCase
from rest_framework import status
from rest_framework.test import APIClient
from core.models import Tag, Recipe
from recipe.serializers import TagSerializer
TAGS_URL = reverse('recipe:tag-list')
class ... | 28.468531 | 71 | 0.608941 |
04e37f8867e970e0e5598cf72725d7bbb1332a92 | 4,184 | py | Python | Best time to buy and sell stock II.py | frank0215/Leetcode_python | 9428ded4f9abd347b12bfef8aa1dd2d177f3afea | [
"MIT"
] | null | null | null | Best time to buy and sell stock II.py | frank0215/Leetcode_python | 9428ded4f9abd347b12bfef8aa1dd2d177f3afea | [
"MIT"
] | null | null | null | Best time to buy and sell stock II.py | frank0215/Leetcode_python | 9428ded4f9abd347b12bfef8aa1dd2d177f3afea | [
"MIT"
] | null | null | null | '''
Say you have an array prices for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profit. You may complete as many transactions as you like (i.e., buy one and sell one share of the stock multiple times).
Note: You may not engage in multiple transactions at the sa... | 27.708609 | 161 | 0.538958 |
89db2f3fd6eb9806ec28ccdfe9095841af7a3916 | 14,687 | py | Python | sfp_mnds.py | themendas/modSpiderfoot | e2ce95c4adcc2560d1f676a7c97e8ac88baa359a | [
"CNRI-Python"
] | null | null | null | sfp_mnds.py | themendas/modSpiderfoot | e2ce95c4adcc2560d1f676a7c97e8ac88baa359a | [
"CNRI-Python"
] | null | null | null | sfp_mnds.py | themendas/modSpiderfoot | e2ce95c4adcc2560d1f676a7c97e8ac88baa359a | [
"CNRI-Python"
] | null | null | null | # -*- coding: utf-8 -*-
# -------------------------------------------------------------------------------
# Name: sfp_modMnds
# Purpose: SpiderFoot plug-in for creating new modules.
#
# Author: Borja Vilaplana <borjavilaplana@gmail.com>
#
# Created: 07/12/2021
# Copyright: (c) Borja Vilaplana @M... | 46.185535 | 159 | 0.626268 |
4b7021d3d0d963c3a20f78ae22267c014654d411 | 1,777 | py | Python | tests/unit/utils/test_json.py | hellmage/pacte | a3b6c2b39b52d6e8c1bb5d0df305e5fc30251fff | [
"MIT"
] | null | null | null | tests/unit/utils/test_json.py | hellmage/pacte | a3b6c2b39b52d6e8c1bb5d0df305e5fc30251fff | [
"MIT"
] | null | null | null | tests/unit/utils/test_json.py | hellmage/pacte | a3b6c2b39b52d6e8c1bb5d0df305e5fc30251fff | [
"MIT"
] | null | null | null | # Copyright (c) 2017 App Annie Inc. All rights reserved.
import unittest as ut
import datetime
import simplejson as json
from pacte.utils.json import DateTimeEncoder, datetime_decoder
class JsonDatetimeTest(ut.TestCase):
def test_datetime_encoder(self):
self.assertEqual(
'{"d": "2018-01-11"}... | 35.54 | 103 | 0.513225 |
da5429830f4c8d4fe5fabf68882420823645e468 | 1,150 | py | Python | aws_lambda_cors/utils/response.py | adrian-pina/aws-lambda-cors | 8382ca060724b2ad4e6cf198cfd5755e609d4afa | [
"MIT"
] | null | null | null | aws_lambda_cors/utils/response.py | adrian-pina/aws-lambda-cors | 8382ca060724b2ad4e6cf198cfd5755e609d4afa | [
"MIT"
] | null | null | null | aws_lambda_cors/utils/response.py | adrian-pina/aws-lambda-cors | 8382ca060724b2ad4e6cf198cfd5755e609d4afa | [
"MIT"
] | null | null | null | import json
from aws_lambda_cors.utils.headers import HEADERS
class AwsLambdaResponse:
def __init__(self, body, headers, status_code=200):
self.status_code = status_code
self.body = body
self.headers = {**HEADERS, **headers}
def parse(self, status_code=None):
if n... | 29.487179 | 73 | 0.583478 |
93c4a8807f7781fe3a723dfa6d934606f63cc6c9 | 2,566 | py | Python | aliyun-python-sdk-snsuapi/aliyunsdksnsuapi/request/v20180709/MobileStartSpeedUpRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-snsuapi/aliyunsdksnsuapi/request/v20180709/MobileStartSpeedUpRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-snsuapi/aliyunsdksnsuapi/request/v20180709/MobileStartSpeedUpRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | # 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... | 32.897436 | 85 | 0.765394 |
ed6c57e62c146966d2e4f5b81b1cfe0d43acd6a8 | 35,994 | py | Python | ORStools/gui/ORStoolsDialogUI.py | Mappboy/orstools-qgis-plugin | 07cac3f331cd96cc12c8555b01d84d75bda7970d | [
"MIT"
] | null | null | null | ORStools/gui/ORStoolsDialogUI.py | Mappboy/orstools-qgis-plugin | 07cac3f331cd96cc12c8555b01d84d75bda7970d | [
"MIT"
] | null | null | null | ORStools/gui/ORStoolsDialogUI.py | Mappboy/orstools-qgis-plugin | 07cac3f331cd96cc12c8555b01d84d75bda7970d | [
"MIT"
] | 1 | 2020-10-13T22:37:52.000Z | 2020-10-13T22:37:52.000Z | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ORStools/gui/ORStoolsDialogUI.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_ORStoolsDialogBase(object):
def setupUi(self, ... | 70.027237 | 297 | 0.751181 |
64b8c74b41d407e7357adf5736836c1e8912ab93 | 35 | py | Python | a.py | tanlangqie/cnn-text-classification-tf | 05f159f9e38275b0b4e3a47c3fe034a59243b476 | [
"Apache-2.0"
] | 1 | 2020-07-04T05:26:56.000Z | 2020-07-04T05:26:56.000Z | a.py | tanlangqie/cnn-text-classification-tf | 05f159f9e38275b0b4e3a47c3fe034a59243b476 | [
"Apache-2.0"
] | null | null | null | a.py | tanlangqie/cnn-text-classification-tf | 05f159f9e38275b0b4e3a47c3fe034a59243b476 | [
"Apache-2.0"
] | null | null | null | ls
[A[3~[3~[Cprint()[D11111)
| 11.666667 | 31 | 0.485714 |
56928c764224813677ba63a55be988ac8b3c272a | 9,107 | py | Python | ding/model/template/bc.py | song2181/DI-engine | 0a39b43f6ad9ef9862878de12b50184f4396be42 | [
"Apache-2.0"
] | 1 | 2022-03-21T16:15:39.000Z | 2022-03-21T16:15:39.000Z | ding/model/template/bc.py | jiaruonan/DI-engine | 268d77db3cb54401b2cfc83e2bc3ec87c31e7b83 | [
"Apache-2.0"
] | null | null | null | ding/model/template/bc.py | jiaruonan/DI-engine | 268d77db3cb54401b2cfc83e2bc3ec87c31e7b83 | [
"Apache-2.0"
] | null | null | null | from typing import Union, Optional, Dict, Callable, List
import torch
import torch.nn as nn
from easydict import EasyDict
from ding.torch_utils import get_lstm
from ding.utils import MODEL_REGISTRY, SequenceType, squeeze
from ..common import FCEncoder, ConvEncoder, DiscreteHead, DuelingHead, \
MultiHead, Regre... | 45.084158 | 119 | 0.580542 |
501de4691e2de951043bd488eead4922c8abc566 | 313 | py | Python | Exercicios Python/ex019.py | ClaudioSiqueira/Exercicios-Python | 128387769b34b7d42aee5c1effda16de21216e10 | [
"MIT"
] | null | null | null | Exercicios Python/ex019.py | ClaudioSiqueira/Exercicios-Python | 128387769b34b7d42aee5c1effda16de21216e10 | [
"MIT"
] | null | null | null | Exercicios Python/ex019.py | ClaudioSiqueira/Exercicios-Python | 128387769b34b7d42aee5c1effda16de21216e10 | [
"MIT"
] | null | null | null | from random import choice
n1 = input('Digite o nome do primeiro aluno: ')
n2 = input('Digite o nome do segundo aluno: ')
n3 = input('Digite o nome do terceiro aluno: ')
n4 = input('Digite o nome do quarto aluno: ')
lista = [n1, n2, n3, n4]
escolhido = choice(lista)
print('O aluno(a) escolhido foi ',escolhido)
| 28.454545 | 47 | 0.693291 |
2f8b34266c38195aa18b8f384b23ae5181a8d2d9 | 13,480 | py | Python | Classifier.py | callistachang/CycleGAN-Music-Transfer | 928e87b4bebc4da1dcf7c43936d2c10fe76170f1 | [
"MIT"
] | null | null | null | Classifier.py | callistachang/CycleGAN-Music-Transfer | 928e87b4bebc4da1dcf7c43936d2c10fe76170f1 | [
"MIT"
] | 1 | 2021-07-07T13:36:18.000Z | 2021-07-07T13:36:18.000Z | Classifier.py | callistachang/CycleGAN-Music-Transfer | 928e87b4bebc4da1dcf7c43936d2c10fe76170f1 | [
"MIT"
] | null | null | null | import os
import numpy as np
from random import shuffle
from collections import namedtuple
from glob import glob
import tensorflow as tf
from tensorflow.keras.optimizers import Adam
from modules import (
build_generator,
build_discriminator_classifier,
softmax_criterion,
)
from utils import get_now_datetim... | 37.032967 | 96 | 0.526113 |
10881beb4394f95b38ca72745f42c1921af84cac | 8,948 | py | Python | scripts/numerics/anaPNPS_uniform.py | jhwnkim/nanopores | 98b3dbb5d36464fbdc03f59d224d38e4255324ce | [
"MIT"
] | 8 | 2016-09-07T01:59:31.000Z | 2021-03-06T12:14:31.000Z | scripts/numerics/anaPNPS_uniform.py | jhwnkim/nanopores | 98b3dbb5d36464fbdc03f59d224d38e4255324ce | [
"MIT"
] | null | null | null | scripts/numerics/anaPNPS_uniform.py | jhwnkim/nanopores | 98b3dbb5d36464fbdc03f59d224d38e4255324ce | [
"MIT"
] | 4 | 2017-12-06T17:43:01.000Z | 2020-05-01T05:41:14.000Z | #FIXME: the current still does not converge, but the potential seems to do.
# plot the other solutions as well! where is the solution not accurate?
" analytical test problem to validate 2D and 3D solvers "
import math
from collections import OrderedDict
from dolfin import *
from nanopores import *
from nanopores.physi... | 32.42029 | 136 | 0.615333 |
b4864d013088da514685442c671d2ad4cd0f3992 | 1,881 | py | Python | src/offchainapi/sample/sample_command.py | mengxu-fb/off-chain-reference | a798fe81b79ef892f71dc58c136f9458ecfd7769 | [
"Apache-2.0"
] | null | null | null | src/offchainapi/sample/sample_command.py | mengxu-fb/off-chain-reference | a798fe81b79ef892f71dc58c136f9458ecfd7769 | [
"Apache-2.0"
] | null | null | null | src/offchainapi/sample/sample_command.py | mengxu-fb/off-chain-reference | a798fe81b79ef892f71dc58c136f9458ecfd7769 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) The Libra Core Contributors
# SPDX-License-Identifier: Apache-2.0
from ..protocol_command import ProtocolCommand
from ..utils import JSONSerializable
from ..shared_object import SharedObject
@JSONSerializable.register
class SampleObject(SharedObject):
def __init__(self, item):
SharedObject... | 31.35 | 95 | 0.666135 |
f316be9bc45a7a09817e72229a6dd2cbb01a29a0 | 3,213 | py | Python | wallace/nodes.py | berkeley-cocosci/Wallace | 3650c0bc3b0804d0adb1d178c5eba9992babb1b0 | [
"MIT"
] | 21 | 2016-06-30T13:14:21.000Z | 2021-01-02T14:29:25.000Z | wallace/nodes.py | jhamrick/Wallace | 3650c0bc3b0804d0adb1d178c5eba9992babb1b0 | [
"MIT"
] | 180 | 2015-07-03T18:42:11.000Z | 2016-06-30T02:59:24.000Z | wallace/nodes.py | berkeley-cocosci/Wallace | 3650c0bc3b0804d0adb1d178c5eba9992babb1b0 | [
"MIT"
] | 8 | 2016-08-06T13:42:49.000Z | 2016-09-05T21:46:06.000Z | """Define kinds of nodes: agents, sources, and environments."""
from wallace.models import Node, Info
from wallace.information import State
from sqlalchemy import Integer
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.sql.expression import cast
from operator import attrgetter
import random
class A... | 28.945946 | 79 | 0.643635 |
bcb1e5dc0a7c1e867f306da03284976a3d92860a | 380 | py | Python | blog/migrations/0002_alter_post_content.py | anurag629/azblog | 9755c15e950eb0f8f89fe7ce09623823e6409681 | [
"MIT"
] | 3 | 2021-10-11T01:24:53.000Z | 2021-11-16T17:25:55.000Z | blog/migrations/0002_alter_post_content.py | anurag629/azblog | 9755c15e950eb0f8f89fe7ce09623823e6409681 | [
"MIT"
] | 4 | 2021-12-11T14:24:46.000Z | 2021-12-17T16:50:14.000Z | blog/migrations/0002_alter_post_content.py | anurag629/azblog | 9755c15e950eb0f8f89fe7ce09623823e6409681 | [
"MIT"
] | 1 | 2021-11-16T17:26:01.000Z | 2021-11-16T17:26:01.000Z | # Generated by Django 3.2.7 on 2021-10-09 12:48
from django.db import migrations
import tinymce.models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='post',
name='content',
... | 19 | 47 | 0.589474 |
32c4c97a5799124f8b06c1fdd07cb0d1fd8ac386 | 1,527 | py | Python | setup.py | danielpatrickhug/Top2Vec | 3f39d4d07f070b3879a928fec375b4bc4eba5a0c | [
"BSD-3-Clause"
] | 1,623 | 2020-03-29T16:20:05.000Z | 2022-03-28T05:36:18.000Z | setup.py | danielpatrickhug/Top2Vec | 3f39d4d07f070b3879a928fec375b4bc4eba5a0c | [
"BSD-3-Clause"
] | 241 | 2020-04-03T02:11:49.000Z | 2022-03-21T07:00:43.000Z | setup.py | danielpatrickhug/Top2Vec | 3f39d4d07f070b3879a928fec375b4bc4eba5a0c | [
"BSD-3-Clause"
] | 258 | 2020-03-30T12:41:57.000Z | 2022-03-31T06:46:51.000Z | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="top2vec",
packages=["top2vec"],
version="1.0.26",
author="Dimo Angelov",
author_email="dimo.angelov@gmail.com",
description="Top2Vec learns jointly embedded topic, document and word ve... | 29.365385 | 84 | 0.578913 |
a6b6748474ca9f28aad6b06654945911cd1c4bfb | 254 | py | Python | ff_espn_api/runner.py | paarthjoshi002/ff-espn-api | 2dc5ac2faeea63c08ce82ff2d724a0972ee6c37a | [
"MIT"
] | null | null | null | ff_espn_api/runner.py | paarthjoshi002/ff-espn-api | 2dc5ac2faeea63c08ce82ff2d724a0972ee6c37a | [
"MIT"
] | null | null | null | ff_espn_api/runner.py | paarthjoshi002/ff-espn-api | 2dc5ac2faeea63c08ce82ff2d724a0972ee6c37a | [
"MIT"
] | null | null | null | ### Initial Start
from ff_espn_api import League
league_id = 1180821
year = 2018
username = 'parth_joshi@hotmail.com'
password = 'Stevemcnair00'
league = League(league_id, year, username, password)
#for team in league.teams:
# print(team.team_name)
| 21.166667 | 52 | 0.755906 |
694ff7df41ddb1b8213a9d0af80a7626f415ffdd | 28,044 | py | Python | semo/RuleSemOMethods.py | helloric/pydial3 | 34988f4592c4e28388b2818de8768d841696efbb | [
"Apache-2.0"
] | null | null | null | semo/RuleSemOMethods.py | helloric/pydial3 | 34988f4592c4e28388b2818de8768d841696efbb | [
"Apache-2.0"
] | null | null | null | semo/RuleSemOMethods.py | helloric/pydial3 | 34988f4592c4e28388b2818de8768d841696efbb | [
"Apache-2.0"
] | null | null | null | ###############################################################################
# PyDial: Multi-domain Statistical Spoken Dialogue System Software
###############################################################################
#
# Copyright 2015 - 2019
# Cambridge University Engineering Department Dialogue Systems Grou... | 38.681379 | 138 | 0.563079 |
d22350c560c894905c2de566929b5603791b9e18 | 11,084 | py | Python | great_expectations/dataset/util.py | schrockn/great_expectations | 686677c322b748346eff9d049fb37ef9256ed3e9 | [
"Apache-2.0"
] | 1 | 2018-09-16T19:14:00.000Z | 2018-09-16T19:14:00.000Z | great_expectations/dataset/util.py | schrockn/great_expectations | 686677c322b748346eff9d049fb37ef9256ed3e9 | [
"Apache-2.0"
] | null | null | null | great_expectations/dataset/util.py | schrockn/great_expectations | 686677c322b748346eff9d049fb37ef9256ed3e9 | [
"Apache-2.0"
] | null | null | null | # Utility methods for dealing with DataSet objects
from __future__ import division
from six import string_types
import numpy as np
from scipy import stats
import pandas as pd
import warnings
import sys
import copy
import datetime
from functools import wraps
def parse_result_format(result_format):
"""This is a... | 35.639871 | 148 | 0.666907 |
1a7aabb23abc93237c717a98b3f6501ab146e9c8 | 3,134 | py | Python | TMM_functions/anisotropic.py | zhaonat/RCWA | a28fdf90b5b5fc0fedacc8bb44a0a0c2f2a02143 | [
"MIT"
] | 66 | 2019-03-11T11:59:26.000Z | 2022-03-25T05:17:11.000Z | TMM_functions/anisotropic.py | Ydeh22/Rigorous-Coupled-Wave-Analysis | 15f4300601899d08f57c95863df88280ab6f0d21 | [
"MIT"
] | 5 | 2018-09-23T05:18:15.000Z | 2021-11-07T20:16:40.000Z | TMM_functions/anisotropic.py | Ydeh22/Rigorous-Coupled-Wave-Analysis | 15f4300601899d08f57c95863df88280ab6f0d21 | [
"MIT"
] | 33 | 2018-09-23T05:16:59.000Z | 2022-03-23T08:37:07.000Z | ''''
anisotropic TMM formulation
PQ formulation breaks down since the
differential equation
dz([ex, ey, hx, hy]) = Gamma ([ex, ey hx, hy])) has a Gamma matrix which is completely dense
'''
import numpy as np
import cmath;
from scipy.linalg import eig
def nonHermitianEigenSorter(eigenvalues):
N = len(eigenvalues)... | 43.527778 | 117 | 0.633057 |
d681e3a45d581e194b045da72786a9d2c8b5573b | 5,861 | py | Python | MoMMI/commands.py | jwhitak/MoMMI | 33b13dd3d6854ee2a2b7a43ef6f5e92559a6da73 | [
"MIT"
] | 18 | 2016-08-06T17:31:59.000Z | 2021-12-24T13:08:02.000Z | MoMMI/commands.py | jwhitak/MoMMI | 33b13dd3d6854ee2a2b7a43ef6f5e92559a6da73 | [
"MIT"
] | 29 | 2016-08-07T14:03:00.000Z | 2022-01-23T21:05:33.000Z | MoMMI/commands.py | jwhitak/MoMMI | 33b13dd3d6854ee2a2b7a43ef6f5e92559a6da73 | [
"MIT"
] | 25 | 2016-08-08T12:56:02.000Z | 2022-02-09T07:17:51.000Z | import asyncio
import logging
import random
import re
import traceback
from typing import Callable, Match, Pattern, Awaitable, Optional, List, Any, TYPE_CHECKING
from discord import Message, User, Reaction
from MoMMI.handler import MHandler
from MoMMI.permissions import bantypes
from MoMMI.role import MRoleType
logger... | 32.203297 | 118 | 0.61423 |
57078a57f64a24b9c0f9b25a6eaecb4101974516 | 1,771 | py | Python | docs/conf.py | joamatab/emepy | 6b3119a4355ff70d7cfd3fdf18224920c22be937 | [
"MIT"
] | null | null | null | docs/conf.py | joamatab/emepy | 6b3119a4355ff70d7cfd3fdf18224920c22be937 | [
"MIT"
] | null | null | null | docs/conf.py | joamatab/emepy | 6b3119a4355ff70d7cfd3fdf18224920c22be937 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 35.42 | 94 | 0.678713 |
bb27495918b519eeed28d83525ecbd9c9b47e681 | 4,534 | py | Python | system_tests/vapp_network_firewall_tests.py | rajeshk2013/vcd-cli | 6c3053d957741c7a8da09006ce073e5af2cb9e0b | [
"Apache-2.0",
"MIT"
] | null | null | null | system_tests/vapp_network_firewall_tests.py | rajeshk2013/vcd-cli | 6c3053d957741c7a8da09006ce073e5af2cb9e0b | [
"Apache-2.0",
"MIT"
] | null | null | null | system_tests/vapp_network_firewall_tests.py | rajeshk2013/vcd-cli | 6c3053d957741c7a8da09006ce073e5af2cb9e0b | [
"Apache-2.0",
"MIT"
] | null | null | null | # VMware vCloud Director Python SDK
# Copyright (c) 2014-2019 VMware, 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/licenses/LICENSE-... | 38.752137 | 79 | 0.670931 |
9b88ea70d18e91b2ee4d950f4ecec238343ef756 | 344 | py | Python | top/api/rest/KfcKeywordSearchRequest.py | SAMZONG/taobao-sdk-python3 | 202a9df2085229838541713bd24433a90d07c7fc | [
"MIT"
] | null | null | null | top/api/rest/KfcKeywordSearchRequest.py | SAMZONG/taobao-sdk-python3 | 202a9df2085229838541713bd24433a90d07c7fc | [
"MIT"
] | null | null | null | top/api/rest/KfcKeywordSearchRequest.py | SAMZONG/taobao-sdk-python3 | 202a9df2085229838541713bd24433a90d07c7fc | [
"MIT"
] | null | null | null | '''
Created by auto_sdk on 2018.07.26
'''
from top.api.base import RestApi
class KfcKeywordSearchRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.apply = None
self.content = None
self.nick = None
def getapiname(self):
return 'taob... | 24.571429 | 56 | 0.709302 |
1caf8b726d2b052b1a2b4632200198aa1a73c075 | 92,500 | py | Python | examples/pytorch/nlp/huggingface_models/common/src/transformers/trainer.py | huggingface/neural-compressor | aaad4c357a86914ffa583753c9a26d949838a2a5 | [
"Apache-2.0"
] | 172 | 2021-09-14T18:34:17.000Z | 2022-03-30T06:49:53.000Z | examples/pytorch/nlp/huggingface_models/common/src/transformers/trainer.py | intel/lp-opt-tool | 130eefa3586b38df6c0ff78cc8807ae273f6a63f | [
"Apache-2.0"
] | 40 | 2021-09-14T02:26:12.000Z | 2022-03-29T08:34:04.000Z | examples/pytorch/nlp/huggingface_models/common/src/transformers/trainer.py | intel/neural-compressor | 16a4a12045fcb468da4d33769aff2c1a5e2ba6ba | [
"Apache-2.0"
] | 33 | 2021-09-15T07:27:25.000Z | 2022-03-25T08:30:57.000Z | # coding=utf-8
# Copyright 2020-present the HuggingFace Inc. team.
#
# 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 ap... | 47.266224 | 190 | 0.642173 |
fd07a3448db306b28edd8e14c755562a9717f30b | 1,491 | py | Python | cropster/app.py | IsabelGreenhouseProject/Cropster | cb731662bb4a6f1b0f6e71bb611f7ce9805fbd11 | [
"BSD-3-Clause"
] | null | null | null | cropster/app.py | IsabelGreenhouseProject/Cropster | cb731662bb4a6f1b0f6e71bb611f7ce9805fbd11 | [
"BSD-3-Clause"
] | null | null | null | cropster/app.py | IsabelGreenhouseProject/Cropster | cb731662bb4a6f1b0f6e71bb611f7ce9805fbd11 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""The app module, containing the app factory function."""
from flask import Flask, render_template
from cropster.settings import ProdConfig
from cropster.assets import assets
from cropster.extensions import (
bcrypt,
cache,
db,
login_manager,
migrate,
debug_toolbar,
)
f... | 26.157895 | 73 | 0.712944 |
c6066c73ef001d92e85ee3a199f317be3d56e05d | 10,101 | py | Python | dcmanager/manager/patch_audit_manager.py | starlingx-staging/stx-kingbird | 9869ad4640e76384fa14f031a59134cd439929a8 | [
"Apache-2.0"
] | null | null | null | dcmanager/manager/patch_audit_manager.py | starlingx-staging/stx-kingbird | 9869ad4640e76384fa14f031a59134cd439929a8 | [
"Apache-2.0"
] | null | null | null | dcmanager/manager/patch_audit_manager.py | starlingx-staging/stx-kingbird | 9869ad4640e76384fa14f031a59134cd439929a8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Ericsson AB.
#
# 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, ... | 42.620253 | 78 | 0.603505 |
863b6d584491db96428adeb4e7709dadb6d75a65 | 361 | py | Python | python3_spider_action/ch13/scrapyseleniumtest/scrapyseleniumtest/items.py | Fly365/py-learn | a7c747af70ca2d6dcf244dc89344fbd26b125987 | [
"Apache-2.0"
] | null | null | null | python3_spider_action/ch13/scrapyseleniumtest/scrapyseleniumtest/items.py | Fly365/py-learn | a7c747af70ca2d6dcf244dc89344fbd26b125987 | [
"Apache-2.0"
] | null | null | null | python3_spider_action/ch13/scrapyseleniumtest/scrapyseleniumtest/items.py | Fly365/py-learn | a7c747af70ca2d6dcf244dc89344fbd26b125987 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/items.html
from scrapy import Item,Field
class ProductItem(Item):
collection = 'products'
images = Field()
price = Field()
deal = Field()
title = Field()
... | 19 | 53 | 0.642659 |
4b922114fe8857917cc97991185cf8a10ca74b3e | 618 | py | Python | lconfig.py | litecord/rest-py | 1fcc08566dafd435e1df701a5928b0806ce9a294 | [
"MIT"
] | null | null | null | lconfig.py | litecord/rest-py | 1fcc08566dafd435e1df701a5928b0806ce9a294 | [
"MIT"
] | 6 | 2018-02-22T21:03:18.000Z | 2018-02-23T21:29:53.000Z | lconfig.py | litecord/rest-py | 1fcc08566dafd435e1df701a5928b0806ce9a294 | [
"MIT"
] | null | null | null | # configuration for litecord rest
# Where to start the webserver
server_url = ('0.0.0.0', 8000)
ssl = False
ssl_certfile = ''
ssl_keyfile = ''
# Where the gateway is in the world
gateway_url = 'ws://localhost:8081/gw'
# Where the litebridge connection will happen
litebridge_server = 'ws://localhost:10101/'
litebridg... | 22.071429 | 55 | 0.708738 |
e9925f2f9433c2707f941482733bd4f6431258fe | 2,162 | py | Python | tests/test_AttributeMapper.py | rowanc1/mypyplate | fb47b574f63b97a736999fc6adaf47f039df4e24 | [
"MIT"
] | 3 | 2016-04-13T17:13:02.000Z | 2016-07-18T20:09:08.000Z | tests/test_AttributeMapper.py | rowanc1/mypyplate | fb47b574f63b97a736999fc6adaf47f039df4e24 | [
"MIT"
] | 3 | 2016-04-13T16:17:03.000Z | 2016-04-24T17:02:02.000Z | tests/test_AttributeMapper.py | rowanc1/mypyplate | fb47b574f63b97a736999fc6adaf47f039df4e24 | [
"MIT"
] | 1 | 2016-07-16T22:32:35.000Z | 2016-07-16T22:32:35.000Z |
import unittest
import numpy as np
from galoshes import AttributeMapper
class TestMeta(unittest.TestCase):
def setUp(self):
pass
def test_mapperAsExpected(self):
class TestAttributeMapper(AttributeMapper):
initMap = {
# Argument Required Rename as ... ... | 28.447368 | 74 | 0.461147 |
2c4800ccf071ff89aeb256134705140c0021e3f1 | 5,888 | py | Python | msgraph/cli/command_modules/usersactions/azext_usersactions/vendored_sdks/usersactions/operations/_userscalendargroupscalendarseventscalendar_operations.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | null | null | null | msgraph/cli/command_modules/usersactions/azext_usersactions/vendored_sdks/usersactions/operations/_userscalendargroupscalendarseventscalendar_operations.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | 22 | 2022-03-29T22:54:37.000Z | 2022-03-29T22:55:27.000Z | msgraph/cli/command_modules/usersactions/azext_usersactions/vendored_sdks/usersactions/operations/_userscalendargroupscalendarseventscalendar_operations.py | microsoftgraph/msgraph-cli-archived | 489f70bf4ede1ce67b84bfb31e66da3e4db76062 | [
"MIT"
] | null | null | null | # 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.066667 | 213 | 0.697351 |
e87cebe5114700c3b5ff544929a42b2a3a8db156 | 637 | py | Python | udemy/01_walkthrough/food_menu_1.py | inderpal2406/python | 7bd7d03a6b3cd09ff16a4447ff495a2393a87a33 | [
"MIT"
] | null | null | null | udemy/01_walkthrough/food_menu_1.py | inderpal2406/python | 7bd7d03a6b3cd09ff16a4447ff495a2393a87a33 | [
"MIT"
] | null | null | null | udemy/01_walkthrough/food_menu_1.py | inderpal2406/python | 7bd7d03a6b3cd09ff16a4447ff495a2393a87a33 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# This script has food iems in a list
# User enters a food item of his choice
# The script then gives an answer if food item is present in list or not
import os
os.system("clear")
food_items=["Burger","Pizza","French Fries","Ice-cream"]
print(f"Welcome to our food bazaar :)")
print()
input_fo... | 33.526316 | 99 | 0.726845 |
1d106e63e38083e2c7d281010d88b5c29617aa90 | 8,417 | py | Python | wave/compat.py | ronaldguillen/wave | 20bb979c917f7634d8257992e6d449dc751256a9 | [
"Apache-2.0"
] | null | null | null | wave/compat.py | ronaldguillen/wave | 20bb979c917f7634d8257992e6d449dc751256a9 | [
"Apache-2.0"
] | null | null | null | wave/compat.py | ronaldguillen/wave | 20bb979c917f7634d8257992e6d449dc751256a9 | [
"Apache-2.0"
] | null | null | null | """
The `compat` module provides support for backwards compatibility with older
versions of Django/Python, and compatibility wrappers around optional packages.
"""
# flake8: noqa
from __future__ import unicode_literals
import django
from django.conf import settings
from django.db import connection, transaction
from d... | 32.249042 | 107 | 0.700487 |
4ca489269a15278c25d11de844909e90e6bf96c2 | 1,468 | py | Python | api/anubis/rpc/lms.py | as14692/Anubis | f77186d90fcb58b67b56570e4daa3f553ba1e61b | [
"MIT"
] | null | null | null | api/anubis/rpc/lms.py | as14692/Anubis | f77186d90fcb58b67b56570e4daa3f553ba1e61b | [
"MIT"
] | null | null | null | api/anubis/rpc/lms.py | as14692/Anubis | f77186d90fcb58b67b56570e4daa3f553ba1e61b | [
"MIT"
] | null | null | null | from typing import List
from anubis.utils.data import with_context
from anubis.utils.logging import logger
@with_context
def assign_missing_questions(user_id: str):
from anubis.lms.questions import fix_missing_question_assignments
from anubis.models import Assignment, Course, InCourse, User
# Log RPC jo... | 29.959184 | 92 | 0.663488 |
396f6b2fcdf7dfaa5368219f04e6baa08f2d4f31 | 17,925 | py | Python | Tools/python37/Lib/test/test_trace.py | xxroot/android_universal | af2d8627182f936383d792c1f775d87da50f2f6d | [
"MIT"
] | 207 | 2018-10-01T08:53:01.000Z | 2022-03-14T12:15:54.000Z | Tools/python37/Lib/test/test_trace.py | xxroot/android_universal | af2d8627182f936383d792c1f775d87da50f2f6d | [
"MIT"
] | 8 | 2019-06-29T14:18:51.000Z | 2022-02-19T07:30:27.000Z | Tools/python37/Lib/test/test_trace.py | xxroot/android_universal | af2d8627182f936383d792c1f775d87da50f2f6d | [
"MIT"
] | 53 | 2019-03-12T16:50:21.000Z | 2022-03-15T23:16:18.000Z | import os
import sys
from test.support import TESTFN, rmtree, unlink, captured_stdout
from test.support.script_helper import assert_python_ok, assert_python_failure
import textwrap
import unittest
import trace
from trace import Trace
from test.tracedmodules import testmod
#-------------------------------... | 37.896406 | 101 | 0.591241 |
e5c703e1bdc6de65fcc83b6f908a241b88240986 | 2,759 | py | Python | azure/mgmt/compute/compute/v2016_03_30/models/data_disk.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 2 | 2020-07-29T14:22:17.000Z | 2020-11-06T18:47:40.000Z | azure/mgmt/compute/compute/v2016_03_30/models/data_disk.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2016-08-01T07:37:04.000Z | 2016-08-01T07:37:04.000Z | azure/mgmt/compute/compute/v2016_03_30/models/data_disk.py | EnjoyLifeFund/py36pkgs | 0ac677fbbfa7b6d8c527fe2c759ba05117b07fd2 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2020-12-12T21:04:41.000Z | 2020-12-12T21:04:41.000Z | # 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 ... | 40.573529 | 99 | 0.624502 |
90845aee6463a4d1e1c53a28e47aef209547437d | 1,608 | py | Python | leetcode/0590_nary_tree_postorder_traversal.py | chaosWsF/Python-Practice | ff617675b6bcd125933024bb4c246b63a272314d | [
"BSD-2-Clause"
] | null | null | null | leetcode/0590_nary_tree_postorder_traversal.py | chaosWsF/Python-Practice | ff617675b6bcd125933024bb4c246b63a272314d | [
"BSD-2-Clause"
] | null | null | null | leetcode/0590_nary_tree_postorder_traversal.py | chaosWsF/Python-Practice | ff617675b6bcd125933024bb4c246b63a272314d | [
"BSD-2-Clause"
] | null | null | null | """
Given an n-ary tree, return the postorder traversal of its nodes' values. Nary-Tree input serialization
is represented in their level order traversal, each group of children is separated by the null value
(See examples).
Follow up: Recursive solution is trivial, could you do it iteratively?
Example 1:
htt... | 25.935484 | 107 | 0.593905 |
6c057b34a0d4e3516d25bbdc8a8d9e617e166f02 | 1,272 | py | Python | jp.atcoder/abc123/abc123_d/8669891.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc123/abc123_d/8669891.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc123/abc123_d/8669891.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import sys
import numpy as np
# sum of deliciousness が border以上の組み合わせが K個以上あればTrue
def is_ok(a, b, c, X, Y, Z, K, border, found=False):
cnt = 0
res = []
for i in range(X):
for j in range(Y):
for k in range(Z):
sum_deli = a[i] + b[j] + c[k]
... | 25.44 | 61 | 0.415094 |
cd4b4bcfbfede8990a67778c3c462e965535c6bd | 15,755 | py | Python | modules/auto_updater.py | gomashio1596/Fortnite-LobbyBot-v2 | e7082e4335b59409dfeaba18e7787acc1db115db | [
"MIT"
] | 21 | 2021-01-17T02:34:51.000Z | 2022-03-17T10:23:23.000Z | modules/auto_updater.py | gomashio1596/Fortnite-LobbyBot-v2 | e7082e4335b59409dfeaba18e7787acc1db115db | [
"MIT"
] | 4 | 2021-05-01T20:35:08.000Z | 2022-03-27T13:59:10.000Z | modules/auto_updater.py | gomashio1596/Fortnite-LobbyBot-v2 | e7082e4335b59409dfeaba18e7787acc1db115db | [
"MIT"
] | 31 | 2021-01-21T21:14:25.000Z | 2022-02-03T09:59:45.000Z | import asyncio
import json
import os
import sys
from typing import TYPE_CHECKING, Optional, Tuple, Union
from aiofiles import open as aopen
from aiofiles.os import remove as aremove
from aiofiles.os import rename as arename
from .localize import LocalizedText
if TYPE_CHECKING:
from .bot import Bot
... | 40.922078 | 141 | 0.397398 |
ca89bc561035ce9c83d31266740b3fc4fb863aae | 4,721 | py | Python | tests/integration/generate_fixtures/go_ethereum.py | pjryan93/web3.py | e066452a7b0e78d6cb8a9462532d169de901ef99 | [
"MIT"
] | 1 | 2021-11-15T19:06:05.000Z | 2021-11-15T19:06:05.000Z | tests/integration/generate_fixtures/go_ethereum.py | pjryan93/web3.py | e066452a7b0e78d6cb8a9462532d169de901ef99 | [
"MIT"
] | null | null | null | tests/integration/generate_fixtures/go_ethereum.py | pjryan93/web3.py | e066452a7b0e78d6cb8a9462532d169de901ef99 | [
"MIT"
] | 1 | 2018-08-29T06:09:03.000Z | 2018-08-29T06:09:03.000Z | import contextlib
import json
import os
import pprint
import shutil
import sys
from eth_utils import (
is_dict,
is_same_address,
)
import common
from web3 import Web3
from web3.utils.module_testing.emitter_contract import (
EMITTER_ABI,
EMITTER_BYTECODE,
EMITTER_ENUM,
)
from web3.utils.module_test... | 31.898649 | 94 | 0.694768 |
19c70d90c4e2e4c4a7a108d24d9dd447df0bcf65 | 837 | py | Python | math_probability/check_prime/check_prime.py | amymhaddad/interactive-coding-challenges | c6389f483f5acb5b4c7f01b9ee1ff92c6a33e4f1 | [
"Apache-2.0"
] | 1 | 2019-07-22T18:43:54.000Z | 2019-07-22T18:43:54.000Z | math_probability/check_prime/check_prime.py | amymhaddad/interactive-coding-challenges | c6389f483f5acb5b4c7f01b9ee1ff92c6a33e4f1 | [
"Apache-2.0"
] | null | null | null | math_probability/check_prime/check_prime.py | amymhaddad/interactive-coding-challenges | c6389f483f5acb5b4c7f01b9ee1ff92c6a33e4f1 | [
"Apache-2.0"
] | null | null | null | """A template to find prime numbers."""
class Primes(object):
def check_prime(self, num):
if (
self.is_greater_than_one(num)
and self.is_whole_number(num)
and self.only_two_factors(num)
and self.not_None(num)
):
return f"Success: {num} is... | 27 | 64 | 0.568698 |
4daa61e9967a6baa8cf210a75a41883287ffa65e | 2,762 | py | Python | noise/D1_v2.py | ikim-quantum/er_noise | 1e577ff75f8d3141116e37e11d22b516a9e38a24 | [
"MIT"
] | null | null | null | noise/D1_v2.py | ikim-quantum/er_noise | 1e577ff75f8d3141116e37e11d22b516a9e38a24 | [
"MIT"
] | null | null | null | noise/D1_v2.py | ikim-quantum/er_noise | 1e577ff75f8d3141116e37e11d22b516a9e38a24 | [
"MIT"
] | null | null | null | ###################################
# Past causal cone calculator: 1D #
# Isaac H. Kim 2020/12/24 #
###################################
import numpy as np
from compressor import pcc, qubits, circ_subtract, rearrange, compress, optimal_width_freeze, depth_width_reduced_freeze
def sites_1d(n, s):
"""
Ar... | 25.574074 | 120 | 0.549602 |
5d865fc0e2e32904db5b1ce217b6b64d5478bf91 | 1,263 | py | Python | world.py | ryansturmer/CraftBot | 74b0038857956bb6d37e2e01833805783df23e5c | [
"MIT"
] | 3 | 2015-02-01T09:05:42.000Z | 2020-10-26T22:35:35.000Z | world.py | ryansturmer/CraftBot | 74b0038857956bb6d37e2e01833805783df23e5c | [
"MIT"
] | null | null | null | world.py | ryansturmer/CraftBot | 74b0038857956bb6d37e2e01833805783df23e5c | [
"MIT"
] | null | null | null | # gcc -std=c99 -O3 -shared -o world \
# -I src -I deps/noise deps/noise/noise.c src/world.c
from ctypes import CDLL, CFUNCTYPE, c_int, c_void_p
from collections import OrderedDict
try:
dll = CDLL('./world')
except:
import os
os.system('gcc -std=c99 -O3 -shared -o world.dll -I src -I deps/noise deps/nois... | 28.704545 | 106 | 0.60966 |
da53ca6e76a545a12878b5f842308e6ffffe708c | 853 | py | Python | get_missing_comments.py | emaadmanzoor/cmv-reputation-experiment | 3b7c81227791c1e0038103b1504912b7141f785a | [
"Apache-2.0"
] | 4 | 2020-08-19T16:38:02.000Z | 2021-09-20T15:24:33.000Z | get_missing_comments.py | emaadmanzoor/cmv-reputation-experiment | 3b7c81227791c1e0038103b1504912b7141f785a | [
"Apache-2.0"
] | 7 | 2020-11-27T03:58:06.000Z | 2021-01-10T19:47:44.000Z | get_missing_comments.py | emaadmanzoor/cmv-reputation-experiment | 3b7c81227791c1e0038103b1504912b7141f785a | [
"Apache-2.0"
] | null | null | null | from psaw import PushshiftAPI
import json
missing = []
with open("missing_comment_ids.txt", "r") as f:
for line in f:
line = line.strip()
missing.append(line)
missing = set(missing)
print(len(missing))
api = PushshiftAPI()
missing_comments_json = list(api.search_comments(subreddit='changemyview',
... | 35.541667 | 76 | 0.509965 |
4988b79f69ad99026f0c6ab9edc9369479d1e195 | 2,127 | py | Python | setup.py | occopus/cloud-handler | a1a05b9aa5905461f5d1e12d7071c7226ee806c6 | [
"Apache-2.0"
] | 1 | 2017-06-02T08:15:02.000Z | 2017-06-02T08:15:02.000Z | setup.py | occopus/resource-handler | a1a05b9aa5905461f5d1e12d7071c7226ee806c6 | [
"Apache-2.0"
] | 1 | 2015-11-23T09:58:26.000Z | 2015-11-23T09:58:26.000Z | setup.py | occopus/cloud-handler | a1a05b9aa5905461f5d1e12d7071c7226ee806c6 | [
"Apache-2.0"
] | 4 | 2015-11-05T08:35:28.000Z | 2015-12-06T21:54:14.000Z | ### Copyright 2014, MTA SZTAKI, www.sztaki.hu
###
### Licensed under the Apache License, Version 2.0 (the "License");
### you may not use this file except in compliance with the License.
### You may obtain a copy of the License at
###
### http://www.apache.org/licenses/LICENSE-2.0
###
### Unless required by applicab... | 29.957746 | 76 | 0.625764 |
b2ea6e42afce7d91bd97f56f68c7990b85664f89 | 534 | py | Python | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/alpha-tv-28453 | 64b72f613fcf3de2716f95bdfd44496e7c9e7b61 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/alpha-tv-28453 | 64b72f613fcf3de2716f95bdfd44496e7c9e7b61 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/alpha-tv-28453 | 64b72f613fcf3de2716f95bdfd44496e7c9e7b61 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "alpha-tv-28453.botics.co"
site_params = {
"name": "Alpha Tv",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.update_or_create... | 20.538462 | 61 | 0.651685 |
70d9fa6b190b575b4029baacb40aa4342fe2d5ce | 47,340 | py | Python | gestaoemp/lib/python3.6/site-packages/pysignfe/nfe/webservices_3.py | jasonrosa92/gestaoempresa | c942c7cb5ff3bd299da94df11eab49b7dd0c7d71 | [
"MIT"
] | null | null | null | gestaoemp/lib/python3.6/site-packages/pysignfe/nfe/webservices_3.py | jasonrosa92/gestaoempresa | c942c7cb5ff3bd299da94df11eab49b7dd0c7d71 | [
"MIT"
] | null | null | null | gestaoemp/lib/python3.6/site-packages/pysignfe/nfe/webservices_3.py | jasonrosa92/gestaoempresa | c942c7cb5ff3bd299da94df11eab49b7dd0c7d71 | [
"MIT"
] | 1 | 2020-11-04T08:45:57.000Z | 2020-11-04T08:45:57.000Z | # -*- coding: utf-8 -*-
from .webservices_flags import *
METODO_WS = {
WS_NFE_ENVIO_LOTE: {
u'webservice': u'NfeRecepcao2',
u'metodo' : u'nfeRecepcaoLote2',
},
WS_NFE_CONSULTA_RECIBO: {
u'webservice': u'NfeRetRecepcao2',
u'metodo' : u'nfeRetRecepcao2',
},... | 50.201485 | 142 | 0.690832 |
4808233c491839aba6294b186c1e15ede201f4b5 | 761 | py | Python | tests/api.py | marcelomanzo/pypcars2api | a9cbd1b2f5f250acddfcab2f5b645ad68fb8f567 | [
"MIT"
] | 2 | 2021-06-13T15:47:31.000Z | 2022-02-21T14:08:17.000Z | tests/api.py | marcelomanzo/pypcars2api | a9cbd1b2f5f250acddfcab2f5b645ad68fb8f567 | [
"MIT"
] | null | null | null | tests/api.py | marcelomanzo/pypcars2api | a9cbd1b2f5f250acddfcab2f5b645ad68fb8f567 | [
"MIT"
] | 1 | 2020-10-26T13:47:57.000Z | 2020-10-26T13:47:57.000Z | import unittest
import pypcars2api
"""
Run tests from the main pypcars2api directory: python -m unittest tests.api
"""
class TestAPI(unittest.TestCase):
def setUp(self):
self.data = pypcars2api.live()
def tearDown(self):
pass
def test_valid_api(self):
self.assertEqual(self.data.mV... | 25.366667 | 91 | 0.651774 |
4910b9ec3ee8d7e94b90d1cf30e94ff838d90cbc | 22 | py | Python | hashpic/__init__.py | GodsNightmare/hashpic | acab8f489bb509773048f31868eeb089153d10ea | [
"MIT"
] | 251 | 2015-12-03T15:42:52.000Z | 2022-03-21T04:39:09.000Z | hashpic/__init__.py | GodsNightmare/hashpic | acab8f489bb509773048f31868eeb089153d10ea | [
"MIT"
] | 436 | 2020-02-11T02:30:52.000Z | 2022-03-31T18:40:45.000Z | hashpic/__init__.py | GodsNightmare/hashpic | acab8f489bb509773048f31868eeb089153d10ea | [
"MIT"
] | 86 | 2015-12-14T12:38:46.000Z | 2022-02-08T13:42:28.000Z | __version__ = "0.7.3"
| 11 | 21 | 0.636364 |
68cf83e4d427112578c370880bd10f6e22867eec | 331 | py | Python | blog/migrations/0024_remove_comment_creation_date.py | MysteryCoder456/Blog-App | 56d28c1b93c113487a36df265ecc677e426b1c62 | [
"MIT"
] | 3 | 2020-06-17T07:35:17.000Z | 2020-06-17T07:45:15.000Z | blog/migrations/0024_remove_comment_creation_date.py | MysteryCoder456/Blog-App | 56d28c1b93c113487a36df265ecc677e426b1c62 | [
"MIT"
] | null | null | null | blog/migrations/0024_remove_comment_creation_date.py | MysteryCoder456/Blog-App | 56d28c1b93c113487a36df265ecc677e426b1c62 | [
"MIT"
] | null | null | null | # Generated by Django 3.1 on 2020-09-19 07:43
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('blog', '0023_auto_20200806_1247'),
]
operations = [
migrations.RemoveField(
model_name='comment',
name='creation_date',
... | 18.388889 | 45 | 0.598187 |
5a99fd1bfcc5f6386917cf6dce2a9561ef80a31a | 2,954 | py | Python | setup.py | cool-RR/scrapy | ec98dabfab60283303a9208ccd8177d9f995ba72 | [
"BSD-3-Clause"
] | 3 | 2020-08-06T04:59:26.000Z | 2020-08-19T01:22:39.000Z | setup.py | cool-RR/scrapy | ec98dabfab60283303a9208ccd8177d9f995ba72 | [
"BSD-3-Clause"
] | null | null | null | setup.py | cool-RR/scrapy | ec98dabfab60283303a9208ccd8177d9f995ba72 | [
"BSD-3-Clause"
] | null | null | null | from os.path import dirname, join
from pkg_resources import parse_version
from setuptools import setup, find_packages, __version__ as setuptools_version
with open(join(dirname(__file__), 'scrapy/VERSION'), 'rb') as f:
version = f.read().decode('ascii').strip()
def has_environment_marker_platform_impl_support():... | 33.954023 | 79 | 0.627962 |
870a47f78154efb1407bfb628fca38e928169189 | 398 | py | Python | music/migrations/0006_auto_20200330_1856.py | Revibe-Music/core-services | 6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2 | [
"MIT"
] | 2 | 2022-01-24T23:30:18.000Z | 2022-01-26T00:21:22.000Z | music/migrations/0006_auto_20200330_1856.py | Revibe-Music/core-services | 6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2 | [
"MIT"
] | null | null | null | music/migrations/0006_auto_20200330_1856.py | Revibe-Music/core-services | 6b11cf16ad2c35d948f3a5c0e7a161e5b7cfc1b2 | [
"MIT"
] | null | null | null | # Generated by Django 3.0 on 2020-03-30 23:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('music', '0005_auto_20200326_1237'),
]
operations = [
migrations.AlterField(
model_name='playlist',
name='date_created'... | 20.947368 | 58 | 0.613065 |
ef267d8cc27c227c85350789522330e9d6ee59fd | 962 | py | Python | async_calendly/enhanced_client/objects/event_invitee.py | dylanmoring/async_calendly | ee7a9a9935431b5fe7be99f931fa21dca55466b4 | [
"MIT"
] | null | null | null | async_calendly/enhanced_client/objects/event_invitee.py | dylanmoring/async_calendly | ee7a9a9935431b5fe7be99f931fa21dca55466b4 | [
"MIT"
] | null | null | null | async_calendly/enhanced_client/objects/event_invitee.py | dylanmoring/async_calendly | ee7a9a9935431b5fe7be99f931fa21dca55466b4 | [
"MIT"
] | null | null | null | from .base_object import CalendlyObject
class EventInvitee(CalendlyObject):
fields = {
'cancel_url': '',
'canceled': '',
'created_at': 'datetime',
'email': '',
'event': '',
'first_name': '',
'last_name': '',
'name': '',
'new_invitee': '',
... | 24.05 | 50 | 0.489605 |
7846a05f2905e626bae9c2ef53805ffbce68cd2b | 5,465 | py | Python | swift/common/middleware/domain_remap.py | ivancich/ceph-swift-fork | c4f7bd09346716c6e934a3a8122928fdbe3a6dc2 | [
"Apache-2.0"
] | 3 | 2017-12-02T23:19:01.000Z | 2018-05-18T07:03:52.000Z | swift/common/middleware/domain_remap.py | ivancich/ceph-swift-fork | c4f7bd09346716c6e934a3a8122928fdbe3a6dc2 | [
"Apache-2.0"
] | 4 | 2017-02-08T20:10:45.000Z | 2018-05-18T13:03:07.000Z | swift/common/middleware/domain_remap.py | ivancich/ceph-swift-fork | c4f7bd09346716c6e934a3a8122928fdbe3a6dc2 | [
"Apache-2.0"
] | 14 | 2015-04-06T17:41:25.000Z | 2020-09-24T02:01:24.000Z | # Copyright (c) 2010-2011 OpenStack, LLC.
#
# 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 ... | 46.313559 | 79 | 0.656542 |
7e8f5f52956e9084d12bd543e68dee8c722037bf | 685 | py | Python | I2C.bme280.oled/clear_scren.py | Ths2-9Y-LqJt6/YANPIWS | e3aa850c1465e63504f234fe43363f65e01d5676 | [
"MIT"
] | 3 | 2017-03-27T05:02:35.000Z | 2020-05-09T23:05:43.000Z | I2C.bme280.oled/clear_scren.py | Ths2-9Y-LqJt6/YANPIWS | e3aa850c1465e63504f234fe43363f65e01d5676 | [
"MIT"
] | 32 | 2017-03-27T05:34:30.000Z | 2020-05-11T19:18:24.000Z | I2C.bme280.oled/clear_scren.py | mrjones-plip/YANPIWS | e3aa850c1465e63504f234fe43363f65e01d5676 | [
"MIT"
] | 2 | 2020-07-14T04:37:32.000Z | 2020-10-15T19:08:12.000Z | #!/usr/bin/python3
from luma.core.interface.serial import i2c
from luma.core.render import canvas
from luma.oled.device import ssd1306
import argparse
import atexit
parser = argparse.ArgumentParser()
# Rev 2 Pi, Pi 2 & Pi 3 uses bus 1
# Rev 1 Pi uses bus 0
# Orange Pi Zero uses bus 0 for pins 1-5 (other pins for bu... | 24.464286 | 89 | 0.710949 |
7e5d7343820ccb72b90fd05d8d87a29931cf9899 | 760 | py | Python | tests/common/plugins/sanity_check/constants.py | William-zx/sonic-mgmt | 3268daf93988fde7d80810f0e4fab1f40b34f6cd | [
"Apache-2.0"
] | null | null | null | tests/common/plugins/sanity_check/constants.py | William-zx/sonic-mgmt | 3268daf93988fde7d80810f0e4fab1f40b34f6cd | [
"Apache-2.0"
] | null | null | null | tests/common/plugins/sanity_check/constants.py | William-zx/sonic-mgmt | 3268daf93988fde7d80810f0e4fab1f40b34f6cd | [
"Apache-2.0"
] | null | null | null |
PRINT_LOGS = {
"version": "show version",
"images": "sonic_installer list",
"docker": "docker ps -a",
"interfaces": "show interface status",
"ip": "show ip interface",
"neigh": "ip neigh",
"bgp": "show bgp summary",
"routes": "ip route | wc -l"
}
# Recover related definitions
RECOVER_M... | 33.043478 | 78 | 0.607895 |
10a994fb356f859e3aa0b8db91815d7c12403e3f | 2,781 | py | Python | chinilla/util/misc.py | Chinilla/chinilla-blockchain | 59bebcf94e65b74fbb53ad4929bbd79cb28be619 | [
"Apache-2.0"
] | null | null | null | chinilla/util/misc.py | Chinilla/chinilla-blockchain | 59bebcf94e65b74fbb53ad4929bbd79cb28be619 | [
"Apache-2.0"
] | null | null | null | chinilla/util/misc.py | Chinilla/chinilla-blockchain | 59bebcf94e65b74fbb53ad4929bbd79cb28be619 | [
"Apache-2.0"
] | null | null | null | import dataclasses
from typing import Any, Dict, Sequence, Union
from chinilla.util.ints import uint16
from chinilla.util.streamable import Streamable, recurse_jsonify, streamable
@streamable
@dataclasses.dataclass(frozen=True)
class VersionedBlob(Streamable):
version: uint16
blob: bytes
def format_bytes(b... | 29.585106 | 109 | 0.641855 |
740040958009e2bc32851d88b2ed2785240d2ed4 | 504 | py | Python | contact/tests/factory.py | mikeleg/crm-headless | a5ccbb05f0cb4dcf9926d0a3155305fb02b6b06e | [
"MIT"
] | 5 | 2020-10-08T12:59:34.000Z | 2022-03-14T07:19:33.000Z | contact/tests/factory.py | mikeleg/crm-headless | a5ccbb05f0cb4dcf9926d0a3155305fb02b6b06e | [
"MIT"
] | null | null | null | contact/tests/factory.py | mikeleg/crm-headless | a5ccbb05f0cb4dcf9926d0a3155305fb02b6b06e | [
"MIT"
] | null | null | null | from account.tests.factory import AccountFactory
from core import fields
import factory
from ..models import Contact
"""
Mock Contact
"""
class ContactFactory(factory.django.DjangoModelFactory):
class Meta:
model = Contact
name = factory.Sequence(lambda n: "name {}".format(n))
surname = fact... | 21 | 68 | 0.706349 |
4e39b1495d34eaaf4ee6bcd60530857e8c50f105 | 3,311 | py | Python | mlens/parallel/tests/test_b3_layer_stack.py | mehrdad-shokri/mlens | 6cbc11354b5f9500a33d9cefb700a1bba9d3199a | [
"MIT"
] | 760 | 2017-03-13T10:11:45.000Z | 2022-03-30T20:59:20.000Z | mlens/parallel/tests/test_b3_layer_stack.py | rahulsaini/mlens | 6cbc11354b5f9500a33d9cefb700a1bba9d3199a | [
"MIT"
] | 115 | 2017-01-18T22:10:33.000Z | 2022-03-17T12:42:34.000Z | mlens/parallel/tests/test_b3_layer_stack.py | rahulsaini/mlens | 6cbc11354b5f9500a33d9cefb700a1bba9d3199a | [
"MIT"
] | 96 | 2017-03-13T10:12:48.000Z | 2022-02-23T17:12:39.000Z | """"ML-ENSEMBLE
Testing suite for Layer and Transformer
"""
from mlens.testing import Data, EstimatorContainer, get_layer, run_layer
def test_fit():
"""[Parallel | Layer | Multiprocessing | Stack | No Proba | No Prep] test fit"""
args = get_layer('fit', 'multiprocessing', 'stack', False, False)
run_layer... | 34.489583 | 103 | 0.66868 |
63c9f8495ce31fccb735ad6556ebca69f2002e08 | 3,888 | py | Python | python/_logging.py | NunoEdgarGFlowHub/poptorch | 2e69b81c7c94b522d9f57cc53d31be562f5e3749 | [
"MIT"
] | null | null | null | python/_logging.py | NunoEdgarGFlowHub/poptorch | 2e69b81c7c94b522d9f57cc53d31be562f5e3749 | [
"MIT"
] | null | null | null | python/_logging.py | NunoEdgarGFlowHub/poptorch | 2e69b81c7c94b522d9f57cc53d31be562f5e3749 | [
"MIT"
] | null | null | null | # Copyright (c) 2020 Graphcore Ltd. All rights reserved.
import datetime as dt
import logging
import os
import sys
import subprocess
import traceback
import poptorch.poptorch_core as poptorch_core
# Create a poptorch logger which outputs to the console INFO messages and above
logger = logging.getLogger("poptorch::pyth... | 30.857143 | 79 | 0.621914 |
7b608317356a089aa6c82598927a88f113f4e50c | 2,809 | py | Python | vklabs/goose3/extractors/publishdate.py | vklab/goose3 | edf30226da920c098f0e2d24a5ee681c3f2d9510 | [
"Apache-2.0"
] | null | null | null | vklabs/goose3/extractors/publishdate.py | vklab/goose3 | edf30226da920c098f0e2d24a5ee681c3f2d9510 | [
"Apache-2.0"
] | 1 | 2019-05-29T18:50:12.000Z | 2019-05-29T18:50:12.000Z | vklabs/goose3/extractors/publishdate.py | vklab/vklabs.goose3 | edf30226da920c098f0e2d24a5ee681c3f2d9510 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""\
This is a python port of "Goose" orignialy licensed to Gravity.com
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.
Python port was written by Xavier Grangier for Recrutae
Gravity.co... | 43.890625 | 92 | 0.625489 |
2e2b819906504e5be2f25e9413c9d5f3806b916e | 4,664 | py | Python | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/aio/operations/_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # 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 ... | 44.419048 | 133 | 0.661235 |
7d39856f1f69d58f6f3a87c79b949ca7a8a92e33 | 669 | py | Python | main.py | PyGamer0/TheTLanguage | 9ae2bfddebc28e5221e320ed90543669add2b05e | [
"MIT"
] | 1 | 2021-07-16T10:51:41.000Z | 2021-07-16T10:51:41.000Z | main.py | PyGamer0/TheTLanguage | 9ae2bfddebc28e5221e320ed90543669add2b05e | [
"MIT"
] | null | null | null | main.py | PyGamer0/TheTLanguage | 9ae2bfddebc28e5221e320ed90543669add2b05e | [
"MIT"
] | null | null | null | # Super simple transplied language
import sys
file = sys.argv[1]
f = open(file, encoding='utf-8')
code = f.readlines()
f.close()
transplied = ""
for line in code:
line = line.replace("def", "_def")
line = line.replace("fn", "def")
line = line.replace("return", "_return")
line = line.replace("ret", "re... | 26.76 | 189 | 0.64275 |
e7b786336882d2e85f0d80d64de226448900be41 | 9,861 | py | Python | calendarserver/tools/tables.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | 1 | 2017-02-18T19:22:19.000Z | 2017-02-18T19:22:19.000Z | calendarserver/tools/tables.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | calendarserver/tools/tables.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | ##
# Copyright (c) 2009-2015 Apple 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/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 31.205696 | 118 | 0.608863 |
589f32f9c180f62eb2f97bc5c1790f41dd834b16 | 2,449 | py | Python | top/clearlight/base/liaoxuefeng/regular_expression/Regular_practice.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | 1 | 2020-01-16T09:23:43.000Z | 2020-01-16T09:23:43.000Z | top/clearlight/base/liaoxuefeng/regular_expression/Regular_practice.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | top/clearlight/base/liaoxuefeng/regular_expression/Regular_practice.py | ClearlightY/Python_learn | 93b9b7efae5a1cf05faf8ee7c5e36dcc99c7a232 | [
"Apache-2.0"
] | null | null | null | import re
'''
匹配边长的字符
.: 任意字符, 可以匹配任何单个字符
*: 任意个字符
+: 至少一个字符
{n}: 表示n个字符
{n,m}: 表示n-m个字符
精确匹配:
\d: 匹配一个数字
\w: 匹配一个数字或字母
[]: 表示范围
更精确的匹配:
[0-9a-zA-Z\_]可以匹配一个数字、字母或者下划线;
[0-9a-zA-Z\_]+可以匹配至少由一个数字、字母或者下划线组成的字符串,比如'a100','0_Z','Py3000'等等;
[a-zA-Z\_][0-9a-zA-Z\_]*可以匹配由字母或下划线开头,后接任意个由一个数字、字母或者下划线组成的字符串,
... | 20.07377 | 140 | 0.587178 |
12fca47efb5bdab582b292e8cc20957301647760 | 1,670 | py | Python | test/test_time_series.py | codacy-badger/toughio | 8d4f3d8408d5507a83f65e7f393b13be08d42aca | [
"MIT"
] | null | null | null | test/test_time_series.py | codacy-badger/toughio | 8d4f3d8408d5507a83f65e7f393b13be08d42aca | [
"MIT"
] | null | null | null | test/test_time_series.py | codacy-badger/toughio | 8d4f3d8408d5507a83f65e7f393b13be08d42aca | [
"MIT"
] | null | null | null | import os
import sys
import tempfile
from copy import deepcopy
import numpy
import pytest
import helpers
import toughio
@pytest.mark.skipif(sys.version_info < (3,), reason="Order of keys in dictionary")
def test_time_series():
# Import hybrid mesh
mesh = deepcopy(helpers.hybrid_mesh)
# Create random ti... | 27.833333 | 88 | 0.656886 |
6be05f436328e0b255d67408ee25e5259949c128 | 3,728 | py | Python | python/paddle/fluid/tests/unittests/test_fleet_base_3.py | OuyangChao/Paddle | cac9635a6733ffbbd816b33e21c3054e0cd81ab1 | [
"Apache-2.0"
] | 10 | 2021-05-12T07:20:32.000Z | 2022-03-04T08:21:56.000Z | python/paddle/fluid/tests/unittests/test_fleet_base_3.py | AFLee/Paddle | 311b3b44fc7d51d4d66d90ab8a3fc0d42231afda | [
"Apache-2.0"
] | 1 | 2021-01-25T09:40:19.000Z | 2021-01-25T09:40:19.000Z | python/paddle/fluid/tests/unittests/test_fleet_base_3.py | AFLee/Paddle | 311b3b44fc7d51d4d66d90ab8a3fc0d42231afda | [
"Apache-2.0"
] | 18 | 2021-05-19T08:01:49.000Z | 2022-02-11T03:11:32.000Z | # Copyright (c) 2020 PaddlePaddle 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 appli... | 40.086022 | 80 | 0.67677 |
77725e9724e8a1ddefb798f42fc24281e92ca49e | 1,401 | py | Python | shopyo/shopyoapi/cmd_helper.py | kancurochat/shopyo | ca280ad33c30c622e5b44b632b09d54aba17f6d4 | [
"MIT"
] | 1 | 2022-03-21T07:02:47.000Z | 2022-03-21T07:02:47.000Z | shopyo/shopyoapi/cmd_helper.py | kancurochat/shopyo | ca280ad33c30c622e5b44b632b09d54aba17f6d4 | [
"MIT"
] | null | null | null | shopyo/shopyoapi/cmd_helper.py | kancurochat/shopyo | ca280ad33c30c622e5b44b632b09d54aba17f6d4 | [
"MIT"
] | null | null | null | """
Helper utility functions for commandline api
"""
import sys
import os
from shutil import rmtree
def remove_pycache(dir_name):
"""removes all __pycache__ starting from directory dir_name
all the way to leaf directory
Args:
dir_name(string) : path from where to start removing pycache
"""... | 27.470588 | 70 | 0.601713 |
b8d5e7893a353eb3a3b43e15ca5b872e277c5212 | 15,799 | py | Python | uuv_control/uuv_trajectory_control/src/uuv_trajectory_generator/path_generator/bezier_curve.py | MoMagDii/VAUV-simulator | 56f55f9349e38e0a327a40feb5a437fcad511b00 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | uuv_control/uuv_trajectory_control/src/uuv_trajectory_generator/path_generator/bezier_curve.py | MoMagDii/VAUV-simulator | 56f55f9349e38e0a327a40feb5a437fcad511b00 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | uuv_control/uuv_trajectory_control/src/uuv_trajectory_generator/path_generator/bezier_curve.py | MoMagDii/VAUV-simulator | 56f55f9349e38e0a327a40feb5a437fcad511b00 | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2021-04-10T18:17:43.000Z | 2021-04-10T21:07:56.000Z | # Copyright (c) 2020 The Plankton Authors.
# All rights reserved.
#
# This source code is derived from UUV Simulator
# (https://github.com/uuvsimulator/uuv_simulator)
# Copyright (c) 2016-2019 The UUV Simulator Authors
# licensed under the Apache license, Version 2.0
# cf. 3rd-party-licenses.txt file in the root direct... | 42.932065 | 159 | 0.525856 |
864d5a819568f1fec879801ab2a8800ad6fc96cc | 2,579 | py | Python | sdk/python/pulumi_azure_nextgen/appplatform/v20200701/get_deployment_log_file_url.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/appplatform/v20200701/get_deployment_log_file_url.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/appplatform/v20200701/get_deployment_log_file_url.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # 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
__a... | 36.323944 | 171 | 0.676619 |
5dbe8e87e56756dedadb905c5461c2fe46c75c47 | 2,204 | py | Python | visdialch/utils/dynamic_rnn.py | gicheonkang/sglkt-visdial | b2927e8bc8e45c2d2a2a76fbf75a15f8ecb78b88 | [
"MIT"
] | 9 | 2021-08-30T16:43:46.000Z | 2022-03-19T12:22:08.000Z | visdialch/utils/dynamic_rnn.py | gicheonkang/sglkt-visdial | b2927e8bc8e45c2d2a2a76fbf75a15f8ecb78b88 | [
"MIT"
] | null | null | null | visdialch/utils/dynamic_rnn.py | gicheonkang/sglkt-visdial | b2927e8bc8e45c2d2a2a76fbf75a15f8ecb78b88 | [
"MIT"
] | 4 | 2021-09-01T01:33:17.000Z | 2021-10-12T05:33:20.000Z | import torch
from torch import nn
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
class DynamicRNN(nn.Module):
def __init__(self, rnn_model):
super().__init__()
self.rnn_model = rnn_model
def forward(self, seq_input, seq_lens, initial_state=None):
"""A wrapper... | 34.984127 | 79 | 0.627042 |
99a5550b0c18cca375e1bf71211b88c487e69a74 | 1,334 | py | Python | 08.py | mheden/adventofcode2019 | a64b1c9e7dd78d1e1c56771c417596b0f2e1d205 | [
"MIT"
] | null | null | null | 08.py | mheden/adventofcode2019 | a64b1c9e7dd78d1e1c56771c417596b0f2e1d205 | [
"MIT"
] | null | null | null | 08.py | mheden/adventofcode2019 | a64b1c9e7dd78d1e1c56771c417596b0f2e1d205 | [
"MIT"
] | null | null | null | from utils import read_file, BIGNUM
def unpack(width, height, data):
data = list(data)
ix = 0
layers = []
while ix < len(data):
row = ""
for _ in range(height):
for _ in range(width):
row += data[ix]
ix += 1
layers.append(row)
re... | 23.403509 | 106 | 0.555472 |
f76d4e351b7b3df1079270cd218b9f6d75228e80 | 117 | py | Python | test.py | berkankadioglu/Bandits-Get-GANs | 8cd5be8d12fc53ba96fe51b737b665ca9baaedef | [
"MIT"
] | null | null | null | test.py | berkankadioglu/Bandits-Get-GANs | 8cd5be8d12fc53ba96fe51b737b665ca9baaedef | [
"MIT"
] | null | null | null | test.py | berkankadioglu/Bandits-Get-GANs | 8cd5be8d12fc53ba96fe51b737b665ca9baaedef | [
"MIT"
] | null | null | null | from tqdm import tqdm
from time import sleep
for _ in tqdm(range(1500)):
# print('Ilkayyyyyyy')
sleep(.2) | 13 | 27 | 0.666667 |
eb0fd7089ddda2756b48222e63688b9cca3ab4b4 | 2,472 | py | Python | calories/main/util/filters.py | jorgemira/Calories | c70aa317f1690ed0d51ef5a8b2d49693a9333fc5 | [
"MIT"
] | null | null | null | calories/main/util/filters.py | jorgemira/Calories | c70aa317f1690ed0d51ef5a8b2d49693a9333fc5 | [
"MIT"
] | 1 | 2021-04-30T21:18:28.000Z | 2021-04-30T21:18:28.000Z | calories/main/util/filters.py | jorgemira/Calories | c70aa317f1690ed0d51ef5a8b2d49693a9333fc5 | [
"MIT"
] | null | null | null | import re
from fiql_parser import parse_str_to_expression, FiqlException
from sqlalchemy_filters import apply_filters, apply_pagination
from sqlalchemy_filters.exceptions import FieldNotFound, BadFilterFormat
from werkzeug.exceptions import abort
def to_fiql(filter_spec: str):
"""Transform a filter specification... | 32.526316 | 86 | 0.633495 |
fddbe7db5107c98ee9c1ac3adb05bb330f7cf7b0 | 2,348 | py | Python | cohda/logger.py | ambimanus/demand-response-cohda | 29b03f9fb264cd1e169ed2ed9a895df9558cb214 | [
"MIT"
] | 1 | 2017-05-04T16:18:23.000Z | 2017-05-04T16:18:23.000Z | cohda/logger.py | ambimanus/demand-response-cohda | 29b03f9fb264cd1e169ed2ed9a895df9558cb214 | [
"MIT"
] | null | null | null | cohda/logger.py | ambimanus/demand-response-cohda | 29b03f9fb264cd1e169ed2ed9a895df9558cb214 | [
"MIT"
] | 1 | 2020-07-26T18:07:31.000Z | 2020-07-26T18:07:31.000Z | # coding=utf-8
import logging
from objectives import Objective
FORMAT = '[%(levelname)-9s] %(message)s'
_LVL_AGENTV = 11
_LVL_AGENT = 12
_LVL_STATS = 21
_LVL_SOLUTION = 22
_LVL_TARGET = 23
_LVL_AGENTV_NAME = 'AGENTV'
_LVL_AGENT_NAME = 'AGENT'
_LVL_STATS_NAME = 'STATS'
_LVL_SOLUTION_NAME = 'SOLUTION'
_LVL_TARGET_NA... | 20.778761 | 76 | 0.612436 |
00dd659e242885a5ef148d35d26827f2c4767a5c | 4,314 | py | Python | vsts/vsts/gallery/v4_1/models/published_extension.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/gallery/v4_1/models/published_extension.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/gallery/v4_1/models/published_extension.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 47.933333 | 343 | 0.633751 |
364dc592df2e167974383d6a10860806dedcee38 | 10,472 | py | Python | codebase/data_providers/dtd.py | NEUdeep/nsganetv2 | acf6fc940b5c22092ca98b1db525f61ec503329d | [
"Apache-2.0"
] | null | null | null | codebase/data_providers/dtd.py | NEUdeep/nsganetv2 | acf6fc940b5c22092ca98b1db525f61ec503329d | [
"Apache-2.0"
] | null | null | null | codebase/data_providers/dtd.py | NEUdeep/nsganetv2 | acf6fc940b5c22092ca98b1db525f61ec503329d | [
"Apache-2.0"
] | null | null | null | import os
import warnings
import numpy as np
from timm.data.transforms import _pil_interp
from timm.data.auto_augment import rand_augment_transform
import torch.utils.data
import torchvision.transforms as transforms
import torchvision.datasets as datasets
from ofa.imagenet_classification.data_providers.base_provider... | 43.8159 | 118 | 0.65508 |
9b071433f8c2be5d0e3a28ae9544f071fd13da40 | 818 | py | Python | luogu/P1596 [USACO10OCT]Lake Counting S/test.py | frederick-wang/algorithm-exercises | 2b402e9346cfa50ec77538f744a1aa7fdaa983a0 | [
"Apache-2.0"
] | 1 | 2022-02-02T13:20:38.000Z | 2022-02-02T13:20:38.000Z | luogu/P1596 [USACO10OCT]Lake Counting S/test.py | frederick-wang/algorithm-exercises | 2b402e9346cfa50ec77538f744a1aa7fdaa983a0 | [
"Apache-2.0"
] | null | null | null | luogu/P1596 [USACO10OCT]Lake Counting S/test.py | frederick-wang/algorithm-exercises | 2b402e9346cfa50ec77538f744a1aa7fdaa983a0 | [
"Apache-2.0"
] | null | null | null | # P1596 [USACO10OCT]Lake Counting S https://www.luogu.com.cn/problem/P1596
# https://www.luogu.com.cn/record/71262438
import sys
sys.setrecursionlimit(10010)
N, M = map(int, input().split())
grid = [list(input().strip()) for _ in range(N)]
vis = [[0] * M for _ in range(N)]
for i in range(N):
for j in range(M):
... | 24.058824 | 75 | 0.477995 |
1f60faa71e6a11f0e547ebaf8aeeb24079d5140b | 613 | py | Python | Interviews/042 Trapping Rain Water/Solution.py | graveszhang/LeetCode-Practice | 72be5ce43048461e0b702b84eee1f2f86f356d11 | [
"MIT"
] | null | null | null | Interviews/042 Trapping Rain Water/Solution.py | graveszhang/LeetCode-Practice | 72be5ce43048461e0b702b84eee1f2f86f356d11 | [
"MIT"
] | null | null | null | Interviews/042 Trapping Rain Water/Solution.py | graveszhang/LeetCode-Practice | 72be5ce43048461e0b702b84eee1f2f86f356d11 | [
"MIT"
] | null | null | null | class Solution:
def trap(self, height: List[int]) -> int:
if len(height) <= 2:
return 0
prev = 0
water = 0
middle = max(height)
x = height.index(middle)
for i in range(0,x):
if (prev > height[i]):
water += (prev - height[i])
... | 24.52 | 45 | 0.417618 |
5458dcc1351f01f09275d8da25c3138a297e6288 | 18,175 | py | Python | evewspace/Map/migrations/0020_auto__add_field_mapsystem_display_order_priority.py | gpapaz/eve-wspace | 6b46d120c5ca8d27546113f51fd74fd7797dcbfc | [
"Apache-2.0"
] | null | null | null | evewspace/Map/migrations/0020_auto__add_field_mapsystem_display_order_priority.py | gpapaz/eve-wspace | 6b46d120c5ca8d27546113f51fd74fd7797dcbfc | [
"Apache-2.0"
] | null | null | null | evewspace/Map/migrations/0020_auto__add_field_mapsystem_display_order_priority.py | gpapaz/eve-wspace | 6b46d120c5ca8d27546113f51fd74fd7797dcbfc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'MapSystem.display_order_priority'
db.add_column(u'Map_map... | 79.714912 | 195 | 0.558569 |
c4c606a5e5af877581c741b184ce11016eb78212 | 11,147 | py | Python | wbia/expt/cfghelpers.py | dylanirion/wildbook-ia | 3b7c30a6e123d87999950bfbb5035c4d9c1a6f5d | [
"Apache-2.0"
] | 20 | 2021-01-19T23:17:21.000Z | 2022-03-21T10:25:56.000Z | wbia/expt/cfghelpers.py | solomonkimunyu/wildbook-ia | ac433d4f2a47b1d905c421a36c497f787003afc3 | [
"Apache-2.0"
] | 58 | 2020-06-05T19:02:48.000Z | 2021-01-14T15:27:33.000Z | wbia/expt/cfghelpers.py | solomonkimunyu/wildbook-ia | ac433d4f2a47b1d905c421a36c497f787003afc3 | [
"Apache-2.0"
] | 9 | 2021-02-13T20:19:46.000Z | 2022-03-29T10:47:11.000Z | # -*- coding: utf-8 -*-
"""
Helper module that helps expand parameters for grid search
DEPRICATE: Most of this can likely be replaced by util_gridsearch
TODO: rectify with versions in util_gridsearch
It turns out a lot of the commandlines made possible here can be generatd by
using bash brace expansion.
http://www.li... | 36.547541 | 107 | 0.549116 |
230303df456af86d50172b8ee122dce11d36b5f1 | 4,893 | py | Python | mobilenet_v1.py | l61012345/Imagidentification | 408f06ba3ea3a1d6b90873f720fed5af4549125e | [
"MIT"
] | 2 | 2020-12-24T16:44:18.000Z | 2020-12-24T17:02:48.000Z | mobilenet_v1.py | l61012345/Imagidentification | 408f06ba3ea3a1d6b90873f720fed5af4549125e | [
"MIT"
] | null | null | null | mobilenet_v1.py | l61012345/Imagidentification | 408f06ba3ea3a1d6b90873f720fed5af4549125e | [
"MIT"
] | null | null | null | import paddle.fluid as fluid
def conv_bn_layer(input, filter_size, num_filters, stride,
padding, channels=None, num_groups=1, act='relu', use_cudnn=True):
conv = fluid.layers.conv2d(input=input,
num_filters=num_filters,
filter_si... | 41.466102 | 87 | 0.369712 |
7de40ca3d491e4745ccb7c9dd9d5490e6189d994 | 35,670 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_network_interfaces_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_network_interfaces_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2015_06_15/aio/operations/_network_interfaces_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # 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 ... | 50.811966 | 316 | 0.672358 |
8ad1a01c82fbbe899ffb385a17b0edc68031fb82 | 6,769 | py | Python | keras/optimizers/optimizer_experimental/sgd.py | itsraina/keras | 5e9376b5b94b6fb445dd52dbfafbc4e95bff5e35 | [
"Apache-2.0"
] | null | null | null | keras/optimizers/optimizer_experimental/sgd.py | itsraina/keras | 5e9376b5b94b6fb445dd52dbfafbc4e95bff5e35 | [
"Apache-2.0"
] | null | null | null | keras/optimizers/optimizer_experimental/sgd.py | itsraina/keras | 5e9376b5b94b6fb445dd52dbfafbc4e95bff5e35 | [
"Apache-2.0"
] | null | null | null | # 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... | 33.181373 | 80 | 0.583838 |
6a91aed07b82b2e8f7ae748f41616c987a4cb9ea | 59,766 | py | Python | rpython/rtyper/memory/gctransform/framework.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | 2 | 2016-07-06T23:30:20.000Z | 2017-05-30T15:59:31.000Z | rpython/rtyper/memory/gctransform/framework.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | null | null | null | rpython/rtyper/memory/gctransform/framework.py | kantai/passe-pypy-taint-tracking | b60a3663f8fe89892dc182c8497aab97e2e75d69 | [
"MIT"
] | 2 | 2020-07-09T08:14:22.000Z | 2021-01-15T18:01:25.000Z | from rpython.annotator import model as annmodel
from rpython.rlib import rgc
from rpython.rtyper import rmodel, annlowlevel
from rpython.rtyper.lltypesystem import lltype, llmemory, rffi, llgroup
from rpython.rtyper.lltypesystem.lloperation import LL_OPERATIONS
from rpython.rtyper.memory import gctypelayout
from rpytho... | 44.869369 | 178 | 0.594586 |
124de0c8e2675047a5e928b414dee0a37f5ad2c3 | 8,180 | py | Python | docs/conf.py | motatoes/rainbowstream | 686d4d1120c273b8de8b0526cd8f3f90b86eb919 | [
"MIT"
] | 1 | 2021-05-12T19:27:46.000Z | 2021-05-12T19:27:46.000Z | docs/conf.py | motatoes/rainbowstream | 686d4d1120c273b8de8b0526cd8f3f90b86eb919 | [
"MIT"
] | null | null | null | docs/conf.py | motatoes/rainbowstream | 686d4d1120c273b8de8b0526cd8f3f90b86eb919 | [
"MIT"
] | 1 | 2021-05-12T19:27:58.000Z | 2021-05-12T19:27:58.000Z | # -*- coding: utf-8 -*-
#
# RainbowStream documentation build configuration file, created by
# sphinx-quickstart on Wed Jul 23 12:26:18 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.... | 31.953125 | 79 | 0.718826 |
a424cc1e79732767a7cf0bf457ab203aa0eb1f6d | 1,783 | py | Python | fingerprints_multi.py | MKCabaj/crystalexplorer-scripts | 48fb5ef9aacf3a5ed79ff37f63b510ab39f0748a | [
"Unlicense"
] | null | null | null | fingerprints_multi.py | MKCabaj/crystalexplorer-scripts | 48fb5ef9aacf3a5ed79ff37f63b510ab39f0748a | [
"Unlicense"
] | null | null | null | fingerprints_multi.py | MKCabaj/crystalexplorer-scripts | 48fb5ef9aacf3a5ed79ff37f63b510ab39f0748a | [
"Unlicense"
] | null | null | null | import sbf
import numpy as np
import matplotlib.pyplot as plt
import re
import glob
def histogram(surface_file):
de, di = read_de_di(surface_file)
return np.histogram2d(di, de, bins=200, range=((0, 2.5), (0, 2.5)))
def read_de_di(surface_file):
f = sbf.read_file(surface_file)
return f['d_e'].data, f[... | 33.641509 | 103 | 0.625911 |
d4623847ee39cf7b818f5747190065bd676321a0 | 7,020 | py | Python | bot.py | NoenLiet/discord-mass-lockdown | c2ed774ca302dd0b0ce1512f92fd033ed3eb3218 | [
"MIT"
] | 1 | 2021-08-05T16:13:09.000Z | 2021-08-05T16:13:09.000Z | bot.py | NoenLiet/discord-mass-lockdown | c2ed774ca302dd0b0ce1512f92fd033ed3eb3218 | [
"MIT"
] | null | null | null | bot.py | NoenLiet/discord-mass-lockdown | c2ed774ca302dd0b0ce1512f92fd033ed3eb3218 | [
"MIT"
] | null | null | null | import discord
import yaml
bot = discord.Client()
bot.ready = False
with open("config.yaml", encoding="utf-8") as o:
config = yaml.load(o.read(), Loader=yaml.FullLoader)
def setup_bot():
bot.GUILD = bot.get_guild(config["GUILD_ID"])
bot.AUTHORIZED_ROLE = (
bot.GUILD.get_role(config["AUTHORIZED... | 27.209302 | 150 | 0.609544 |
88ae5d391f804bf242a1c5b02c5af59427368966 | 24,576 | py | Python | build/ninja/clang.py | mjansson/foundation_lib | 1cda247d13a038b6242d8063194c6c552c30c88f | [
"Unlicense"
] | 52 | 2019-11-21T06:15:17.000Z | 2022-03-30T18:10:28.000Z | build/ninja/clang.py | mjansson/foundation_lib | 1cda247d13a038b6242d8063194c6c552c30c88f | [
"Unlicense"
] | 1 | 2020-04-10T17:51:30.000Z | 2020-04-10T17:51:30.000Z | build/ninja/clang.py | mjansson/foundation_lib | 1cda247d13a038b6242d8063194c6c552c30c88f | [
"Unlicense"
] | 3 | 2019-11-22T03:37:02.000Z | 2021-07-13T16:26:05.000Z | #!/usr/bin/env python
"""Ninja toolchain abstraction for Clang compiler suite"""
import os
import subprocess
import toolchain
class ClangToolchain(toolchain.Toolchain):
def initialize(self, project, archs, configs, includepaths, dependlibs, libpaths, variables, subninja):
#Local variable defaults
self.to... | 45.093578 | 317 | 0.653483 |
27d47bd216fcd130d2df0d70a703d13fb05fa3bc | 13,862 | py | Python | venv/Lib/site-packages/skimage/filters/rank/_percentile.py | amelliaaas/tugastkc4 | f442382c72379e911f3780543b95345a3b1c9407 | [
"Apache-2.0"
] | 4 | 2021-10-20T12:39:09.000Z | 2022-02-26T15:02:08.000Z | venv/Lib/site-packages/skimage/filters/rank/_percentile.py | amelliaaas/tugastkc4 | f442382c72379e911f3780543b95345a3b1c9407 | [
"Apache-2.0"
] | 7 | 2021-06-08T21:46:24.000Z | 2022-03-12T00:35:31.000Z | venv/Lib/site-packages/skimage/filters/rank/_percentile.py | amelliaaas/tugastkc4 | f442382c72379e911f3780543b95345a3b1c9407 | [
"Apache-2.0"
] | 20 | 2021-11-07T13:55:56.000Z | 2021-12-02T10:54:01.000Z | """Inferior and superior ranks, provided by the user, are passed to the kernel
function to provide a softer version of the rank filters. E.g.
``autolevel_percentile`` will stretch image levels between percentile [p0, p1]
instead of using [min, max]. It means that isolated bright or dark pixels will
not produce halos.
... | 35.005051 | 80 | 0.634108 |
d12dbe2d4b130d204410d50d18d4fc14bcc9cc9c | 692 | py | Python | edit_scripts/replace.py | github-livingston/lagrit_site | 4c596616bcd4cafeed3ba0a13ba64df5632b004c | [
"CC0-1.0"
] | 73 | 2017-02-09T17:54:28.000Z | 2022-03-09T22:22:32.000Z | edit_scripts/replace.py | github-livingston/lagrit_site | 4c596616bcd4cafeed3ba0a13ba64df5632b004c | [
"CC0-1.0"
] | 166 | 2017-01-26T17:15:45.000Z | 2022-03-29T21:36:28.000Z | docs/edit_scripts/replace.py | daniellivingston/LaGriT | decd0ce0e5dab068034ef382cabcd134562de832 | [
"Intel"
] | 63 | 2017-02-08T21:56:04.000Z | 2022-03-24T06:48:36.000Z | # replace or remove text and formatting that is not wanted in website
import os, sys
def filter_file(infile_name, no, yes):
outfile_name = infile_name[:-3] + '_temp.md'
with open(infile_name, 'r') as infile, open(outfile_name, 'w') as outfile:
data = infile.read()
data = data.replace(no, yes)
outfile.write(d... | 25.62963 | 75 | 0.618497 |
8fe830cb421180d83b9109cf881c67c472dcbb77 | 472 | py | Python | HiveMind/allauth/account/migrations/0014_auto_20161205_0329.py | Jorbeatz/HiveMind | 48e74bcc1bd58cb4850f8f2a5b44447ad4cb4a62 | [
"MIT"
] | 1 | 2019-06-26T19:23:55.000Z | 2019-06-26T19:23:55.000Z | HiveMind/allauth/account/migrations/0014_auto_20161205_0329.py | Jorbeatz/HiveMind | 48e74bcc1bd58cb4850f8f2a5b44447ad4cb4a62 | [
"MIT"
] | null | null | null | HiveMind/allauth/account/migrations/0014_auto_20161205_0329.py | Jorbeatz/HiveMind | 48e74bcc1bd58cb4850f8f2a5b44447ad4cb4a62 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-12-05 08:29
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('account', '0013_auto_20161205_0328'),
]
operations = [
migrations.AlterFiel... | 22.47619 | 72 | 0.620763 |
9af5852da04583015559909e56d8378947a57fcf | 1,242 | py | Python | scraper/tester.py | Heanthor/auctioneer-bot | b98f537b217e33cfa6ea397d6056c978b0b46565 | [
"MIT"
] | 8 | 2018-12-08T01:59:25.000Z | 2021-02-20T10:24:12.000Z | scraper/tester.py | Heanthor/auctioneer-bot | b98f537b217e33cfa6ea397d6056c978b0b46565 | [
"MIT"
] | 88 | 2018-10-09T03:40:25.000Z | 2022-02-27T21:04:45.000Z | scraper/tester.py | Heanthor/auctioneer-bot | b98f537b217e33cfa6ea397d6056c978b0b46565 | [
"MIT"
] | 1 | 2020-11-28T20:57:24.000Z | 2020-11-28T20:57:24.000Z | import json
with open('recipes.json') as f:
recipe_dict = json.load(f)
truncated_string_of_recipe_dict = str(recipe_dict)
spellID_text_space = 10
number_of_spellIDs = truncated_string_of_recipe_dict.count("'spellID': ")
loop_count = 0
while loop_count < number_of_spellIDs :
loop_count += 1
# print("{}/{... | 36.529412 | 126 | 0.795491 |
9fc902aa152e3799d3c2050360bd4af085092b95 | 10,162 | py | Python | purity_fb/purity_fb_1dot3/models/hardware.py | unixtreme/purity_fb_python_client | e836afe9804ffa99f74bf4b5202f181c3c04d9df | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot3/models/hardware.py | unixtreme/purity_fb_python_client | e836afe9804ffa99f74bf4b5202f181c3c04d9df | [
"Apache-2.0"
] | null | null | null | purity_fb/purity_fb_1dot3/models/hardware.py | unixtreme/purity_fb_python_client | e836afe9804ffa99f74bf4b5202f181c3c04d9df | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Purity//FB REST Client
Client for Purity//FB REST API (1.0 - 1.3), developed by [Pure Storage, Inc](http://www.purestorage.com/). Documentations can be found at [purity-fb.readthedocs.io](http://purity-fb.readthedocs.io/).
OpenAPI spec version: 1.3
Contact: info@purestorage.com
... | 25.029557 | 203 | 0.550777 |
06782000ad22ef7203c1faf6476e65cc3b4146bd | 444 | py | Python | nornir/plugins/tasks/data/load_json.py | MatthiasGabriel/nornir | af948f20daee725f9bf257b0e73b688838ebcbc2 | [
"Apache-2.0"
] | 1 | 2019-04-10T08:14:59.000Z | 2019-04-10T08:14:59.000Z | nornir/plugins/tasks/data/load_json.py | MatthiasGabriel/nornir | af948f20daee725f9bf257b0e73b688838ebcbc2 | [
"Apache-2.0"
] | null | null | null | nornir/plugins/tasks/data/load_json.py | MatthiasGabriel/nornir | af948f20daee725f9bf257b0e73b688838ebcbc2 | [
"Apache-2.0"
] | null | null | null | import json
from nornir.core.task import Result
def load_json(task, file):
"""
Loads a json file.
Arguments:
file (str): path to the file containing the json file to load
Returns:
:obj:`nornir.core.task.Result`:
* result (``dict``): dictionary with the contents of the file... | 21.142857 | 71 | 0.612613 |
760a8c9d6fd3b55c430079401376736a98b84baa | 23,630 | py | Python | bfair/session.py | santegoeds/bfair | 36c80fe60a570b6aa4ac030fc202648acb8d08c9 | [
"Apache-2.0"
] | null | null | null | bfair/session.py | santegoeds/bfair | 36c80fe60a570b6aa4ac030fc202648acb8d08c9 | [
"Apache-2.0"
] | 36 | 2015-07-06T15:10:33.000Z | 2015-07-06T15:10:39.000Z | bfair/session.py | santegoeds/bfair | 36c80fe60a570b6aa4ac030fc202648acb8d08c9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2011 Tjerk Santegoeds
#
# 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 applicabl... | 34.801178 | 88 | 0.614135 |
f84f2c656ebcfbf67e9a6e4bb01cd7c410ad0f46 | 21,346 | py | Python | fossdriver/server.py | smcv/fossdriver | 18410187b0a90654510f34dd783b456c53e681dd | [
"BSD-3-Clause"
] | 11 | 2018-10-10T07:59:23.000Z | 2021-02-23T11:18:25.000Z | fossdriver/server.py | smcv/fossdriver | 18410187b0a90654510f34dd783b456c53e681dd | [
"BSD-3-Clause"
] | 30 | 2018-10-05T13:58:06.000Z | 2022-02-01T14:31:37.000Z | fossdriver/server.py | smcv/fossdriver | 18410187b0a90654510f34dd783b456c53e681dd | [
"BSD-3-Clause"
] | 13 | 2018-12-13T11:17:39.000Z | 2022-01-17T14:44:28.000Z | # Copyright Contributors to the fossdriver project.
# SPDX-License-Identifier: BSD-3-Clause OR MIT
import json
import logging
from mimetypes import MimeTypes
import os
import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder
import time
import urllib
import io
import sys
from version_parser imp... | 39.67658 | 113 | 0.606249 |
53a42e668ee5d3c434f6ae679c0cbee92e74f447 | 4,280 | py | Python | model/cifar10_input.py | MapleLeafKiller/tensorflow-triplet-loss | ac349e344a647c5aeed7248926a76a0fe64f4cb7 | [
"MIT"
] | null | null | null | model/cifar10_input.py | MapleLeafKiller/tensorflow-triplet-loss | ac349e344a647c5aeed7248926a76a0fe64f4cb7 | [
"MIT"
] | null | null | null | model/cifar10_input.py | MapleLeafKiller/tensorflow-triplet-loss | ac349e344a647c5aeed7248926a76a0fe64f4cb7 | [
"MIT"
] | null | null | null | # 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... | 40.761905 | 84 | 0.727103 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.