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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cf932b6b1aef935c1e708c38eef6e7cbd0b0f792 | 33,196 | py | Python | nova/tests/unit/api/openstack/placement/test_util.py | cloudscale-ch/nova | 4b4e005c639204f2c680eda61131a6930379d70e | [
"Apache-2.0"
] | 1 | 2018-05-27T09:38:17.000Z | 2018-05-27T09:38:17.000Z | nova/tests/unit/api/openstack/placement/test_util.py | liyingjun/nova | dcdcb273606f52093f812b8f0903da404b15732b | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/api/openstack/placement/test_util.py | liyingjun/nova | dcdcb273606f52093f812b8f0903da404b15732b | [
"Apache-2.0"
] | null | null | null | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 37.007804 | 79 | 0.575099 |
a11e7847958dcd21f11b7c0dedc55bf1d17e56c0 | 2,492 | py | Python | tools/install_venv.py | citrix-openstack-build/python-ceilometerclient | c3283ec1e861f29a53c59c1a09f2a1bc21a713e4 | [
"Apache-2.0"
] | null | null | null | tools/install_venv.py | citrix-openstack-build/python-ceilometerclient | c3283ec1e861f29a53c59c1a09f2a1bc21a713e4 | [
"Apache-2.0"
] | null | null | null | tools/install_venv.py | citrix-openstack-build/python-ceilometerclient | c3283ec1e861f29a53c59c1a09f2a1bc21a713e4 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2010 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2... | 33.226667 | 79 | 0.712681 |
44d2e5f1b7e974d3b135805daec957720bdbfaf2 | 1,049 | py | Python | r8/cli/teams.py | mhils/r8 | b5b0cfa5045213abe896eea450012924d3e1fe9c | [
"MIT"
] | 14 | 2018-09-19T15:17:38.000Z | 2022-01-14T10:59:55.000Z | r8/cli/teams.py | mhils/r8 | b5b0cfa5045213abe896eea450012924d3e1fe9c | [
"MIT"
] | 3 | 2019-05-29T16:47:36.000Z | 2020-05-02T18:16:17.000Z | r8/cli/teams.py | mhils/r8 | b5b0cfa5045213abe896eea450012924d3e1fe9c | [
"MIT"
] | 3 | 2020-12-19T01:12:15.000Z | 2021-02-27T21:29:43.000Z | import click
import r8
from r8 import util
@click.group("teams")
def cli():
"""Team-related commands."""
pass
@cli.command("list")
@util.with_database()
@util.database_rows
def list(rows):
"""Print all teams."""
util.run_sql(f"""
SELECT tid, uid FROM teams
ORDER BY tid, uid DESC
""", ro... | 26.897436 | 105 | 0.624404 |
cccb09892483f6ae03bbe724290901da9613e607 | 13,621 | py | Python | models.py | philippWassibauer/geonames | a479c5d903924af24dbd35b1caeab66a2d93fdd3 | [
"MIT"
] | null | null | null | models.py | philippWassibauer/geonames | a479c5d903924af24dbd35b1caeab66a2d93fdd3 | [
"MIT"
] | null | null | null | models.py | philippWassibauer/geonames | a479c5d903924af24dbd35b1caeab66a2d93fdd3 | [
"MIT"
] | 1 | 2020-01-23T05:03:22.000Z | 2020-01-23T05:03:22.000Z | # This file is part of Django-Geonames
# Copyright (c) 2008, Alberto Garcia Hierro
# See LICENSE file for details
from math import sin, cos, acos, radians
from django.core.cache import cache
from django.db import connection
from django.contrib.gis.db import models
from django.utils.translation import ugettext, get_la... | 34.836317 | 171 | 0.647236 |
0ad6571627f4bc1eb4190c8061b453b2a9137ebe | 5,061 | py | Python | scripts/evaluate_solution.py | steven-murray/analytic_diffuse | b82fea27da4c476b4d04c2a0d8959e5af38bdd09 | [
"MIT"
] | null | null | null | scripts/evaluate_solution.py | steven-murray/analytic_diffuse | b82fea27da4c476b4d04c2a0d8959e5af38bdd09 | [
"MIT"
] | null | null | null | scripts/evaluate_solution.py | steven-murray/analytic_diffuse | b82fea27da4c476b4d04c2a0d8959e5af38bdd09 | [
"MIT"
] | null | null | null | # script to evaluate a given visibility solution and save to npz.
# optionally -- parse a pyuvdata-compatible file to get baseline vectors etc. and save alongside evaluated data.
# give model parameters (and name) as arguments. Option to parse a filename for that info too.
import numpy as np
import os
import argpars... | 38.052632 | 166 | 0.666469 |
407ec963320ad44058cec9b738a0fe93b423899c | 5,287 | py | Python | lib/sqlalchemy/future/selectable.py | abrahamsangha/sqlalchemy | 3ab2364e78641c4f0e4b6456afc2cbed39b0d0e6 | [
"MIT"
] | null | null | null | lib/sqlalchemy/future/selectable.py | abrahamsangha/sqlalchemy | 3ab2364e78641c4f0e4b6456afc2cbed39b0d0e6 | [
"MIT"
] | null | null | null | lib/sqlalchemy/future/selectable.py | abrahamsangha/sqlalchemy | 3ab2364e78641c4f0e4b6456afc2cbed39b0d0e6 | [
"MIT"
] | null | null | null | from ..sql import coercions
from ..sql import roles
from ..sql.base import _generative
from ..sql.selectable import GenerativeSelect
from ..sql.selectable import Select as _LegacySelect
from ..sql.selectable import SelectState
from ..sql.util import _entity_namespace_key
class Select(_LegacySelect):
_is_future = ... | 32.435583 | 78 | 0.632117 |
161ab0379c67974e3c7c09f7565ed3a6a49d5275 | 5,218 | py | Python | qf_lib/backtesting/orders_filter/volume_orders_filter.py | quarkfin/QF-Lib | 1504c65c9ed8bbbd19948088fe7b924a7b6be709 | [
"Apache-2.0"
] | null | null | null | qf_lib/backtesting/orders_filter/volume_orders_filter.py | quarkfin/QF-Lib | 1504c65c9ed8bbbd19948088fe7b924a7b6be709 | [
"Apache-2.0"
] | null | null | null | qf_lib/backtesting/orders_filter/volume_orders_filter.py | quarkfin/QF-Lib | 1504c65c9ed8bbbd19948088fe7b924a7b6be709 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016-present CERN – European Organization for Nuclear Research
#
# 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... | 45.373913 | 120 | 0.673246 |
f82a49482c561a06c31f66897e3a6dc16406c335 | 7,295 | py | Python | model-optimizer/mo/front/common/partial_infer/multi_box_detection_test.py | zhoub/dldt | e42c01cf6e1d3aefa55e2c5df91f1054daddc575 | [
"Apache-2.0"
] | 3 | 2020-02-09T23:25:37.000Z | 2021-01-19T09:44:12.000Z | model-optimizer/mo/front/common/partial_infer/multi_box_detection_test.py | zhoub/dldt | e42c01cf6e1d3aefa55e2c5df91f1054daddc575 | [
"Apache-2.0"
] | null | null | null | model-optimizer/mo/front/common/partial_infer/multi_box_detection_test.py | zhoub/dldt | e42c01cf6e1d3aefa55e2c5df91f1054daddc575 | [
"Apache-2.0"
] | 2 | 2020-04-18T16:24:39.000Z | 2021-01-19T09:42:19.000Z | """
Copyright (c) 2018-2019 Intel Corporation
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 i... | 56.115385 | 104 | 0.537903 |
8621222cce83ccae2b5fe5d557b5c9ece5f258f8 | 604 | py | Python | samples/abp/test_graphics.py | jproudlo/PyModel | 2ab0e2cf821807206725adaa425409b0c28929b7 | [
"BSD-3-Clause"
] | 61 | 2015-01-29T16:18:51.000Z | 2021-09-28T10:14:02.000Z | samples/abp/test_graphics.py | vikstr/PyModel | 4fff616fe0fd8342c91a42d9db5d4097a179dff8 | [
"BSD-3-Clause"
] | 2 | 2015-02-04T11:57:53.000Z | 2021-07-18T20:59:55.000Z | samples/abp/test_graphics.py | vikstr/PyModel | 4fff616fe0fd8342c91a42d9db5d4097a179dff8 | [
"BSD-3-Clause"
] | 34 | 2015-02-04T12:00:29.000Z | 2022-03-14T07:41:25.000Z | """
ABP analyzer and graphics tests
"""
cases = [
('Run Pymodel Graphics to generate dot file from FSM model, no need use pma',
'pmg ABP'),
('Generate SVG file from dot',
'dotsvg ABP'),
# Now display ABP.dot in browser
('Run PyModel Analyzer to generate FSM from original FSM, should be the... | 24.16 | 82 | 0.653974 |
fbe80abb91241ecbc4880e675c8dab97acd79f15 | 13,360 | py | Python | compiler/router.py | PietPtr/verilog2minecraft | 911a4e35df80c340747bbc7b53019a90cbac9e3b | [
"MIT"
] | null | null | null | compiler/router.py | PietPtr/verilog2minecraft | 911a4e35df80c340747bbc7b53019a90cbac9e3b | [
"MIT"
] | null | null | null | compiler/router.py | PietPtr/verilog2minecraft | 911a4e35df80c340747bbc7b53019a90cbac9e3b | [
"MIT"
] | null | null | null | import random
import time
from itertools import product
from typing import List, Tuple, Set, Dict, Any, NamedTuple, Optional
from enum import Enum
from amulet import Block
from amulet_nbt import TAG_String
from compiler.graph import Cell
from util.coord import tupleAdd, tupleSub
import heapq
from util.wool import Wo... | 42.278481 | 155 | 0.586527 |
eef38bea3443926d8d425f77554280cd099d424e | 21,360 | py | Python | MesSudokus/SudokuHillClimbing4.py | rubenbuelvas/IFT3335-TP1 | f7de85e9fecfa55946f996616a9f7043cc182a1b | [
"MIT"
] | null | null | null | MesSudokus/SudokuHillClimbing4.py | rubenbuelvas/IFT3335-TP1 | f7de85e9fecfa55946f996616a9f7043cc182a1b | [
"MIT"
] | null | null | null | MesSudokus/SudokuHillClimbing4.py | rubenbuelvas/IFT3335-TP1 | f7de85e9fecfa55946f996616a9f7043cc182a1b | [
"MIT"
] | 1 | 2021-03-02T22:43:31.000Z | 2021-03-02T22:43:31.000Z | # Hill climing approach to solve a sudoku puzzle
# Inspired by Stochastic search / optimization methods from https://en.wikipedia.org/wiki/Sudoku_solving_algorithms
## Initial code copied from http://norvig.com/sudoku.html
# Will work mostly with grid_values instead of values used in the Norvig sudoku.py (no possib... | 48.545455 | 166 | 0.606554 |
b9dc9214f12464dc4c36c9d7c0f322f6c8f3f8d2 | 670 | py | Python | run_example.py | CostelloLab/GSEA-InContext_noTk | ee1a845cc978cb0da8d296b51e3f36dc26234a63 | [
"MIT"
] | null | null | null | run_example.py | CostelloLab/GSEA-InContext_noTk | ee1a845cc978cb0da8d296b51e3f36dc26234a63 | [
"MIT"
] | null | null | null | run_example.py | CostelloLab/GSEA-InContext_noTk | ee1a845cc978cb0da8d296b51e3f36dc26234a63 | [
"MIT"
] | null | null | null | import gsea_incontext_notk
import sys, logging
rnk = "GSE4773_DEG_Expt1_Control_vs_Group1_gene.rnk"
# Run GSEA preranked - Hallmarks
#prerank_results = gsea_incontext_notk.prerank(
# rnk='data/rnk_lists/' + rnk,
# gene_sets='data/gene_sets/hallmarks.gmt',
# outdir='out/Prerank_Hallmarks/' + rnk[:-4],
# permutation_nu... | 25.769231 | 69 | 0.768657 |
6732e29e140b176a2682f7332434edddea3153fa | 34 | py | Python | player/clues.py | jzlou/auto-hanabi | ad580a5d9a5d5a487bafcbfd97b88a3dc71632ef | [
"MIT"
] | 2 | 2018-12-14T10:39:41.000Z | 2021-04-28T16:03:47.000Z | player/clues.py | jzlou/auto-hanabi | ad580a5d9a5d5a487bafcbfd97b88a3dc71632ef | [
"MIT"
] | null | null | null | player/clues.py | jzlou/auto-hanabi | ad580a5d9a5d5a487bafcbfd97b88a3dc71632ef | [
"MIT"
] | null | null | null | def test():
print("it worked!")
| 11.333333 | 21 | 0.588235 |
70408ad52f12f33cb93617a2f77728545b754fef | 46,692 | py | Python | src/sage/combinat/set_partition_ordered.py | fchapoton/sage | 765c5cb3e24dd134708eca97e4c52e0221cd94ba | [
"BSL-1.0"
] | 1 | 2020-08-30T04:27:27.000Z | 2020-08-30T04:27:27.000Z | src/sage/combinat/set_partition_ordered.py | fchapoton/sage | 765c5cb3e24dd134708eca97e4c52e0221cd94ba | [
"BSL-1.0"
] | null | null | null | src/sage/combinat/set_partition_ordered.py | fchapoton/sage | 765c5cb3e24dd134708eca97e4c52e0221cd94ba | [
"BSL-1.0"
] | 1 | 2020-07-23T10:40:14.000Z | 2020-07-23T10:40:14.000Z | r"""
Ordered Set Partitions
AUTHORS:
- Mike Hansen
- MuPAD-Combinat developers (for algorithms and design inspiration)
- Travis Scrimshaw (2013-02-28): Removed ``CombinatorialClass`` and added
entry point through :class:`OrderedSetPartition`.
"""
#******************************************************************... | 33.044586 | 172 | 0.492161 |
a083b11e2f70f493ffad22134db53448a26f3c71 | 851 | py | Python | pdml2flow/logging.py | Enteee/pdml2flow | 2e5da6f03bc799f0e8ef77dd987031b969d4a5df | [
"Apache-2.0"
] | 12 | 2016-04-01T10:59:14.000Z | 2022-01-27T04:05:43.000Z | pdml2flow/logging.py | Enteee/pdml2flow | 2e5da6f03bc799f0e8ef77dd987031b969d4a5df | [
"Apache-2.0"
] | 16 | 2016-03-18T10:44:00.000Z | 2019-08-12T05:52:24.000Z | pdml2flow/logging.py | Enteee/pdml2flow | 2e5da6f03bc799f0e8ef77dd987031b969d4a5df | [
"Apache-2.0"
] | 2 | 2016-09-08T11:49:39.000Z | 2020-09-09T04:39:15.000Z | # vim: set fenc=utf8 ts=4 sw=4 et :
import sys
from .conf import Conf
def debug(*args):
# import here because of circular dependencies
from .flow import Flow
if Conf.DEBUG:
print(
'[Debug: {}] '.format(
Flow.newest_overall_frame_time
),
*args,
... | 21.275 | 50 | 0.553467 |
98550c3d67773465e204b8e565e9aed335e86437 | 16,853 | py | Python | sample_data/Set-PD-Ix-100/3_Analyses/DOE_Ix-PD-100/Input_point1/Imperfection_point1/DoE_point72/script_DoE72_meshing.py | hanklu2020/mabessa_F3DAS | 57b1bd1cb85d96567ad1044c216535ab3df88db3 | [
"BSD-3-Clause"
] | null | null | null | sample_data/Set-PD-Ix-100/3_Analyses/DOE_Ix-PD-100/Input_point1/Imperfection_point1/DoE_point72/script_DoE72_meshing.py | hanklu2020/mabessa_F3DAS | 57b1bd1cb85d96567ad1044c216535ab3df88db3 | [
"BSD-3-Clause"
] | null | null | null | sample_data/Set-PD-Ix-100/3_Analyses/DOE_Ix-PD-100/Input_point1/Imperfection_point1/DoE_point72/script_DoE72_meshing.py | hanklu2020/mabessa_F3DAS | 57b1bd1cb85d96567ad1044c216535ab3df88db3 | [
"BSD-3-Clause"
] | null | null | null | # Abaqus/CAE script
# Created by M.A. Bessa (M.A.Bessa@tudelft.nl) on 12-Nov-2019 05:29:40
#
from abaqus import *
from abaqusConstants import *
session.viewports['Viewport: 1'].makeCurrent()
#session.viewports['Viewport: 1'].maximize()
from caeModules import *
from driverUtils import executeOnCaeStartup
executeOnCaeSta... | 44.467018 | 206 | 0.692933 |
1c3bfa42909e72f3da5ec15ede1344602925a55d | 118 | py | Python | ELAB02/02-08.py | tawanchaiii/01204111_63 | edf1174f287f5174d93729d9b5c940c74d3b6553 | [
"WTFPL"
] | null | null | null | ELAB02/02-08.py | tawanchaiii/01204111_63 | edf1174f287f5174d93729d9b5c940c74d3b6553 | [
"WTFPL"
] | null | null | null | ELAB02/02-08.py | tawanchaiii/01204111_63 | edf1174f287f5174d93729d9b5c940c74d3b6553 | [
"WTFPL"
] | null | null | null | x = int(input())
l = [1000,500,100,50,20,10,5,1]
for i in range(8):
print(f"{l[i]} => {x//l[i]}")
x = x%l[i] | 16.857143 | 32 | 0.466102 |
1a339db0fc264095507bb7ddeb15a7dd997feacc | 3,029 | py | Python | lecture_04/assignment_03/Ina_Cheibas/assignment_03.py | g-jami/COMPAS-II-FS2021 | 3282036db5f7caa2d904370d47878e578092ae24 | [
"MIT"
] | 48 | 2021-11-27T05:28:31.000Z | 2022-02-06T16:08:30.000Z | lecture_04/assignment_03/Ina_Cheibas/assignment_03.py | g-jami/COMPAS-II-FS2021 | 3282036db5f7caa2d904370d47878e578092ae24 | [
"MIT"
] | 15 | 2021-03-03T10:50:59.000Z | 2021-06-21T07:47:47.000Z | lecture_04/assignment_03/Ina_Cheibas/assignment_03.py | g-jami/COMPAS-II-FS2021 | 3282036db5f7caa2d904370d47878e578092ae24 | [
"MIT"
] | 25 | 2021-03-02T15:08:11.000Z | 2022-03-29T14:34:20.000Z | # """Assignment 03: Using inverse kinematics
# """
import json
import os
from compas_fab.backends import RosClient
from compas_fab.robots import Configuration
from compas.geometry import Frame
from compas.geometry import Point
from compas.geometry import Vector
from compas_fab.utilities import write_data_to_json
# Th... | 48.854839 | 120 | 0.679762 |
59ef87b582c06e01fd47588ae7e4513cdf32250e | 15,675 | py | Python | src/util/util.py | Depersonalizc/pixel-nerf | 35e70fdecdac49b75764158e01d6751b7ad87910 | [
"BSD-2-Clause"
] | 703 | 2020-12-04T02:41:05.000Z | 2022-03-31T07:59:50.000Z | src/util/util.py | Depersonalizc/pixel-nerf | 35e70fdecdac49b75764158e01d6751b7ad87910 | [
"BSD-2-Clause"
] | 46 | 2020-12-08T23:00:54.000Z | 2022-03-26T03:06:07.000Z | src/util/util.py | Depersonalizc/pixel-nerf | 35e70fdecdac49b75764158e01d6751b7ad87910 | [
"BSD-2-Clause"
] | 118 | 2020-12-04T05:37:11.000Z | 2022-03-28T03:34:50.000Z | import cv2
import numpy as np
import torch
from torchvision import transforms
from torch import nn
from torch.nn import init
import torch.nn.functional as F
import functools
import math
import warnings
def image_float_to_uint8(img):
"""
Convert a float image (0.0-1.0) to uint8 (0-255)
"""
vmin = np.mi... | 29.081633 | 100 | 0.583349 |
f8c72f5c3e8213dd831b99c6d1d8d2bf2995f7a8 | 4,070 | py | Python | marmousi/marmousi2_tools.py | HSE-LAMBDA/RheologyReconstruction | fe89dea28ab0873d075e69c51e9ae2aeb07fe8e2 | [
"Apache-2.0"
] | 1 | 2021-01-12T11:43:31.000Z | 2021-01-12T11:43:31.000Z | marmousi/marmousi2_tools.py | HSE-LAMBDA/RheologyReconstruction | fe89dea28ab0873d075e69c51e9ae2aeb07fe8e2 | [
"Apache-2.0"
] | null | null | null | marmousi/marmousi2_tools.py | HSE-LAMBDA/RheologyReconstruction | fe89dea28ab0873d075e69c51e9ae2aeb07fe8e2 | [
"Apache-2.0"
] | null | null | null | import os
import shutil
import requests
from tqdm import tqdm
from obspy.io.segy.core import _read_segy
import numpy as np
import matplotlib.pyplot as plt
def get_marmousi2_data_location():
# download link and friends
SOURCE_URL = "https://s3.amazonaws.com/open.source.geoscience/open_data/elastic-marmousi/... | 33.089431 | 137 | 0.692875 |
e214512d5be19e5e29ce15b38dd48ea538abb606 | 14,381 | py | Python | ens/main.py | ayushkumar63123/web3.py | 4dda2db9d27a409f1a9c2b4a8ec917b53c51383f | [
"MIT"
] | 3,041 | 2017-11-22T16:23:46.000Z | 2022-03-31T15:19:39.000Z | ens/main.py | ayushkumar63123/web3.py | 4dda2db9d27a409f1a9c2b4a8ec917b53c51383f | [
"MIT"
] | 1,506 | 2017-11-22T15:44:34.000Z | 2022-03-31T18:40:05.000Z | ens/main.py | ayushkumar63123/web3.py | 4dda2db9d27a409f1a9c2b4a8ec917b53c51383f | [
"MIT"
] | 1,095 | 2017-11-22T18:20:22.000Z | 2022-03-31T13:05:31.000Z | from functools import (
wraps,
)
from typing import (
TYPE_CHECKING,
Optional,
Sequence,
Tuple,
Union,
cast,
)
from eth_typing import (
Address,
ChecksumAddress,
HexAddress,
)
from eth_utils import (
is_binary_address,
is_checksum_address,
to_checksum_address,
)
from... | 37.064433 | 100 | 0.630346 |
9a319683472467779aad97a3b6410849b862bc8a | 440 | py | Python | packages/python/plotly/plotly/validators/histogram2d/colorbar/_bordercolor.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/histogram2d/colorbar/_bordercolor.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/histogram2d/colorbar/_bordercolor.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class BordercolorValidator(_plotly_utils.basevalidators.ColorValidator):
def __init__(
self, plotly_name="bordercolor", parent_name="histogram2d.colorbar", **kwargs
):
super(BordercolorValidator, self).__init__(
plotly_name=plotly_name,
... | 31.428571 | 85 | 0.670455 |
dd40a79298db328cccabd0cff23824aa2bf0ae0c | 9,327 | py | Python | code/stable/glassbr/src/python/Interpolation.py | Danki567/Drasil | d6bd7d0564710ae70b4847301d3d4df3f83fba11 | [
"BSD-2-Clause"
] | 2 | 2021-06-24T15:39:55.000Z | 2021-06-24T16:57:00.000Z | code/stable/glassbr/src/python/Interpolation.py | Danki567/Drasil | d6bd7d0564710ae70b4847301d3d4df3f83fba11 | [
"BSD-2-Clause"
] | null | null | null | code/stable/glassbr/src/python/Interpolation.py | Danki567/Drasil | d6bd7d0564710ae70b4847301d3d4df3f83fba11 | [
"BSD-2-Clause"
] | null | null | null | ## \file Interpolation.py
# \author Nikitha Krithnan and W. Spencer Smith
# \brief Provides functions for linear interpolation on three-dimensional data
import ReadTable
## \brief Performs linear interpolation
# \param x_1 lower x-coordinate
# \param y_1 lower y-coordinate
# \param x_2 upper x-coordinate
# \param y_2 ... | 39.689362 | 88 | 0.604803 |
b0f8ba0dff5eebe7506a4bd4803fa885aeca1a46 | 6,509 | py | Python | crawler.py | AlisonJonantan/crawlerlivescore | 96ba6213c2eea3aa91d794eb6e5c2f650e1364ac | [
"Apache-2.0"
] | 5 | 2018-08-08T20:38:57.000Z | 2022-02-01T15:21:58.000Z | crawler.py | Maarcosv99/crawlerlivescore | 96ba6213c2eea3aa91d794eb6e5c2f650e1364ac | [
"Apache-2.0"
] | null | null | null | crawler.py | Maarcosv99/crawlerlivescore | 96ba6213c2eea3aa91d794eb6e5c2f650e1364ac | [
"Apache-2.0"
] | 5 | 2018-08-01T17:58:28.000Z | 2022-02-11T03:35:09.000Z | import requests
from bs4 import BeautifulSoup
from administracao.models import Analise, Prognostico
from core.models import JogoAnaliseAoVivo, JogoAoVivo
# CRAWLER DO PLACAR DE FUTEBOL
def autenticacaoPlacar():
url = 'https://www.placardefutebol.com.br/jogos-de-hoje'
proxies = {'http': '107.170.42.158:80'}
... | 36.161111 | 120 | 0.584268 |
eae8f927d0fdb4a9d3b14261b008b52ad0300f41 | 4,794 | py | Python | code/make_features.py | lvniqi/tianchi_power | 4e2e5bb979dc068f4d37341ec43b8993ff71cd12 | [
"MIT"
] | 13 | 2017-08-18T02:15:05.000Z | 2019-11-06T12:57:31.000Z | code/make_features.py | lvniqi/tianchi_power | 4e2e5bb979dc068f4d37341ec43b8993ff71cd12 | [
"MIT"
] | null | null | null | code/make_features.py | lvniqi/tianchi_power | 4e2e5bb979dc068f4d37341ec43b8993ff71cd12 | [
"MIT"
] | 11 | 2017-08-09T08:08:00.000Z | 2019-11-06T12:57:35.000Z | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Thu May 18 19:17:04 2017
@author: boweiy
"""
import pandas as pd
import numpy as np
from multiprocessing import Pool as m_Pool
from preprocess import get_dataset,get_user_id_list,increase_index
from preprocess import save_month_df,save_history_df
from prepr... | 32.835616 | 93 | 0.666458 |
fcf4889933740a449feedd6cfb64149050165b8f | 25,122 | py | Python | neutron/privileged/agent/linux/ip_lib.py | 1pintbeer/neutron | f5a827c2be06f24a1f8025f120f16c12eb1b1f55 | [
"Apache-2.0"
] | null | null | null | neutron/privileged/agent/linux/ip_lib.py | 1pintbeer/neutron | f5a827c2be06f24a1f8025f120f16c12eb1b1f55 | [
"Apache-2.0"
] | null | null | null | neutron/privileged/agent/linux/ip_lib.py | 1pintbeer/neutron | f5a827c2be06f24a1f8025f120f16c12eb1b1f55 | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 33.948649 | 79 | 0.638405 |
9f89fc5e16180695eccef0483180176338191822 | 526 | py | Python | plotly/validators/histogram2d/colorbar/_showexponent.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/histogram2d/colorbar/_showexponent.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/histogram2d/colorbar/_showexponent.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class ShowexponentValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name='showexponent',
parent_name='histogram2d.colorbar',
**kwargs
):
super(ShowexponentValidator, self).__init__(
p... | 26.3 | 78 | 0.60076 |
2a5cdb47300e78039ff43dddd59df2d712c72610 | 18,528 | py | Python | pterotactyl/policies/DDQN/train.py | maurock/Active-3D-Vision-and-Touch | 39e24de0ad3c3caad5d78b7cb351e95d4691c88c | [
"MIT"
] | 10 | 2021-10-29T18:04:03.000Z | 2022-03-22T11:42:13.000Z | pterotactyl/policies/DDQN/train.py | maurock/Active-3D-Vision-and-Touch | 39e24de0ad3c3caad5d78b7cb351e95d4691c88c | [
"MIT"
] | null | null | null | pterotactyl/policies/DDQN/train.py | maurock/Active-3D-Vision-and-Touch | 39e24de0ad3c3caad5d78b7cb351e95d4691c88c | [
"MIT"
] | 3 | 2021-11-05T16:45:27.000Z | 2021-12-22T12:53:06.000Z | # 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.
import os
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import DataLoader
import torch
import argparse
from submitit.... | 35.090909 | 118 | 0.559046 |
16af61e638573807c8563c7163fbde1370bb1cab | 5,540 | py | Python | tests/resources/test_recordings.py | burhanahmed-plivo/plivo-python | 61f86f20efb2bdd30a9ae40ed837c20af42f20b9 | [
"MIT"
] | null | null | null | tests/resources/test_recordings.py | burhanahmed-plivo/plivo-python | 61f86f20efb2bdd30a9ae40ed837c20af42f20b9 | [
"MIT"
] | null | null | null | tests/resources/test_recordings.py | burhanahmed-plivo/plivo-python | 61f86f20efb2bdd30a9ae40ed837c20af42f20b9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from datetime import datetime
import plivo
from tests.base import PlivoResourceTestCase
from tests.decorators import with_response
class RecordingTest(PlivoResourceTestCase):
@with_response(200)
def test_list(self):
recordings = self.client.recordings.list(
add_ti... | 36.688742 | 256 | 0.629242 |
d25189e4bf5ced157698f78e6dc7aebe1ee3455f | 3,790 | py | Python | json2rst/cmd.py | zed-eiq/bad-json-to-rst-tables | e9f022f68e1ea292370261c9b0c9116915802438 | [
"Apache-2.0"
] | null | null | null | json2rst/cmd.py | zed-eiq/bad-json-to-rst-tables | e9f022f68e1ea292370261c9b0c9116915802438 | [
"Apache-2.0"
] | null | null | null | json2rst/cmd.py | zed-eiq/bad-json-to-rst-tables | e9f022f68e1ea292370261c9b0c9116915802438 | [
"Apache-2.0"
] | 1 | 2021-03-24T14:38:50.000Z | 2021-03-24T14:38:50.000Z | import argparse
import logging
from pathlib import Path
from typing import Tuple, Set
from . import utils
from .pivot import Pivot
logging.basicConfig(level=logging.DEBUG)
def _cli() -> any:
"""
CLI helper.
Returns:
a argparse.Namespace object, that looks very much like a NamedTuple
"""
... | 23.836478 | 77 | 0.622164 |
4f4358c3f2bfb4eba389a9ed0317af4a2cd514b7 | 2,165 | py | Python | GoogleStockPriceRNN.py | sd1998/GoogleStockPriceRNN | fb4da83ab3137d6c3eecfa3b964daa80ad9a8324 | [
"Apache-2.0"
] | null | null | null | GoogleStockPriceRNN.py | sd1998/GoogleStockPriceRNN | fb4da83ab3137d6c3eecfa3b964daa80ad9a8324 | [
"Apache-2.0"
] | null | null | null | GoogleStockPriceRNN.py | sd1998/GoogleStockPriceRNN | fb4da83ab3137d6c3eecfa3b964daa80ad9a8324 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
dataset_train = pd.read_csv('Google_Stock_Price_Train.csv')
training_set = dataset_train.iloc[:, 1:2].values
from sklearn.preprocessing import MinMaxScaler
sc = MinMaxScaler(feature_range = (0, 1))
training_set_scaled = sc.fit_transform(training_se... | 40.849057 | 93 | 0.757506 |
e21258a3eccf78fde0dfbc0bf8e9a764669b2a27 | 3,742 | py | Python | django_spanner/functions.py | MShaffar19/python-spanner-django | 62c22b113b470776cddacbab92c4428c6581c551 | [
"BSD-3-Clause"
] | 1 | 2020-12-01T14:30:04.000Z | 2020-12-01T14:30:04.000Z | django_spanner/functions.py | prakhargurunani/python-spanner-django | 818324708e9ca46fbd80c47745bdf38e8a1a069c | [
"BSD-3-Clause"
] | 1 | 2021-02-23T12:32:32.000Z | 2021-02-23T12:32:32.000Z | django_spanner/functions.py | prakhargurunani/python-spanner-django | 818324708e9ca46fbd80c47745bdf38e8a1a069c | [
"BSD-3-Clause"
] | 1 | 2020-10-04T10:04:55.000Z | 2020-10-04T10:04:55.000Z | # Copyright 2020 Google LLC
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file or at
# https://developers.google.com/open-source/licenses/bsd
import math
from django.db.models.expressions import Func, Value
from django.db.models.functions import (
Cast,
Chr,... | 26.167832 | 78 | 0.663014 |
a83383c3006bb95b83fd1f186c757cf42753c4c3 | 3,299 | py | Python | breakdown/templatetags.py | Goldmund-Wyldebeast-Wunderliebe/jinja-breakdown | c6296d54ea6c9f1185039cab7495d5833ba6437f | [
"Apache-2.0"
] | 1 | 2020-08-04T04:51:28.000Z | 2020-08-04T04:51:28.000Z | breakdown/templatetags.py | Goldmund-Wyldebeast-Wunderliebe/jinja-breakdown | c6296d54ea6c9f1185039cab7495d5833ba6437f | [
"Apache-2.0"
] | null | null | null | breakdown/templatetags.py | Goldmund-Wyldebeast-Wunderliebe/jinja-breakdown | c6296d54ea6c9f1185039cab7495d5833ba6437f | [
"Apache-2.0"
] | null | null | null | """
Breakdown.py - 2011 Concentric Sky
Lightweight jinja2 template prototyping server with support for
some custom template tags
Copyright 2011 Concentric Sky, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy... | 28.196581 | 86 | 0.593816 |
c2a3d179dc713d65a8a409b53318592e3fa46b76 | 1,888 | py | Python | forum_tag/forum_tag/spiders/search_spider.py | chrisfromthelc/wpcom-forum-scraper | 82d123f243c6830c2529a5fdfadffccef4975e36 | [
"BSD-3-Clause"
] | null | null | null | forum_tag/forum_tag/spiders/search_spider.py | chrisfromthelc/wpcom-forum-scraper | 82d123f243c6830c2529a5fdfadffccef4975e36 | [
"BSD-3-Clause"
] | 1 | 2022-03-02T14:53:20.000Z | 2022-03-02T14:53:20.000Z | forum_tag/forum_tag/spiders/search_spider.py | chrisfromthelc/wpcom-forum-scraper | 82d123f243c6830c2529a5fdfadffccef4975e36 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
class TagSpiderSpider(scrapy.Spider):
name = 'tag_spider'
allowed_domains = ["wordpress.com"]
start_urls = ['https://wordpress.com/forums/topic-tag/seo/'] # edit this URL for the tag URL you want
custom_settings = {'CLOSESPIDER_PAGECOUNT': 100}
def parse(self... | 38.530612 | 161 | 0.587924 |
59e061169fa08b5f0a419e3a4899b6b0f6d11573 | 6,820 | py | Python | tools/accuracy_checker/accuracy_checker/annotation_converters/squad_emb.py | APrigarina/open_model_zoo | b1ff98b64a6222cf6b5f3838dc0271422250de95 | [
"Apache-2.0"
] | 1,031 | 2020-07-16T08:30:57.000Z | 2022-03-30T19:42:52.000Z | tools/accuracy_checker/accuracy_checker/annotation_converters/squad_emb.py | APrigarina/open_model_zoo | b1ff98b64a6222cf6b5f3838dc0271422250de95 | [
"Apache-2.0"
] | 966 | 2020-07-16T08:13:00.000Z | 2022-03-31T18:09:18.000Z | tools/accuracy_checker/accuracy_checker/annotation_converters/squad_emb.py | APrigarina/open_model_zoo | b1ff98b64a6222cf6b5f3838dc0271422250de95 | [
"Apache-2.0"
] | 440 | 2020-07-16T12:52:50.000Z | 2022-03-31T14:21:41.000Z | """
Copyright (c) 2018-2021 Intel Corporation
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 wr... | 35.520833 | 118 | 0.596481 |
ec08c455d9f40119cd7d9791e94ecd98206f4975 | 847 | py | Python | skfem/element/element_quad/element_quad1.py | YerbaPage/scikit-fem | e5140e0648e4a0f1ea0b60de90851ab49d369453 | [
"BSD-3-Clause"
] | null | null | null | skfem/element/element_quad/element_quad1.py | YerbaPage/scikit-fem | e5140e0648e4a0f1ea0b60de90851ab49d369453 | [
"BSD-3-Clause"
] | null | null | null | skfem/element/element_quad/element_quad1.py | YerbaPage/scikit-fem | e5140e0648e4a0f1ea0b60de90851ab49d369453 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from ..element_h1 import ElementH1
from ...mesh.mesh2d import MeshQuad
class ElementQuad1(ElementH1):
nodal_dofs = 1
dim = 2
maxdeg = 2
dofnames = ['u']
doflocs = np.array([[0., 0.],
[1., 0.],
[1., 1.],
[0... | 22.289474 | 47 | 0.378985 |
778e7c20944ec3673b761010e0bded567b235394 | 644 | py | Python | client/checkout/tests/test_models.py | daniel-waruo/e-commerse-api | 6b080039398fb4099a34335317d649dd67783f63 | [
"Apache-2.0"
] | 6 | 2019-11-21T10:09:49.000Z | 2021-06-19T09:52:59.000Z | client/checkout/tests/test_models.py | daniel-waruo/e-commerse-api | 6b080039398fb4099a34335317d649dd67783f63 | [
"Apache-2.0"
] | null | null | null | client/checkout/tests/test_models.py | daniel-waruo/e-commerse-api | 6b080039398fb4099a34335317d649dd67783f63 | [
"Apache-2.0"
] | null | null | null | from django.contrib.auth import get_user_model
from django.test import TestCase, RequestFactory
# models test
class UserProfileTest(TestCase):
"""
Test whether user profile is created after user creation
"""
def setUp(self):
# Every test needs access to the request factory.
self.reques... | 28 | 60 | 0.656832 |
97650773dfeda2d22c5ef85e68c07b2233eb467b | 2,123 | py | Python | setup.py | CAM-Gerlach/ivaldi | 07fa74ac328d3caae6e1e9811f649178eda01925 | [
"MIT"
] | null | null | null | setup.py | CAM-Gerlach/ivaldi | 07fa74ac328d3caae6e1e9811f649178eda01925 | [
"MIT"
] | null | null | null | setup.py | CAM-Gerlach/ivaldi | 07fa74ac328d3caae6e1e9811f649178eda01925 | [
"MIT"
] | 1 | 2020-02-18T04:40:06.000Z | 2020-02-18T04:40:06.000Z | #!/usr/bin/env python3
"""
Setup script for Ivaldi.
"""
# Standard library imports
from pathlib import Path
# Third party imports
import setuptools
PROJECT_NAME = "ivaldi"
with open(Path(__file__).resolve().parent / "README.md",
"r", encoding="utf-8") as readme_file:
LONG_DESCRIPTION = readme_file.r... | 31.220588 | 76 | 0.628356 |
1b032d7df048e879cb131d3ededb5f240f3327c2 | 1,266 | py | Python | db_tutorial.py | Gerard-007/diaryApp | 2245cb2c6cca763112f68aba1ac1f7d7ebccd9b7 | [
"MIT"
] | null | null | null | db_tutorial.py | Gerard-007/diaryApp | 2245cb2c6cca763112f68aba1ac1f7d7ebccd9b7 | [
"MIT"
] | null | null | null | db_tutorial.py | Gerard-007/diaryApp | 2245cb2c6cca763112f68aba1ac1f7d7ebccd9b7 | [
"MIT"
] | null | null | null | from peewee import *
db = SqliteDatabase("students.db")
class Student(Model):
username = CharField(max_length=255, unique=True)
points = IntegerField(default=0)
class Meta:
database = db
#user inputs stores as dictionary...
students = [
{'username': 'Gerard',
'points': 200... | 26.375 | 85 | 0.611374 |
d52f3bcf4e4d1093fc0e3387a628fa0b55258166 | 840 | py | Python | core/frontend/migrations/0001_initial.py | LegolasVzla/django-rest-framework-orientdb-postgresql | e7c412bd905a91210bfe863f31fea9ec78fe830e | [
"MIT"
] | 2 | 2019-06-26T12:33:32.000Z | 2019-06-26T21:22:10.000Z | core/frontend/migrations/0001_initial.py | LegolasVzla/django-rest-framework-orientdb-postgresql | e7c412bd905a91210bfe863f31fea9ec78fe830e | [
"MIT"
] | 6 | 2019-12-04T22:58:04.000Z | 2022-02-10T13:17:09.000Z | core/frontend/migrations/0001_initial.py | LegolasVzla/django-rest-framework-orientdb-postgresql | e7c412bd905a91210bfe863f31fea9ec78fe830e | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-06-06 20:01
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Company',
fields=[
('id', models.AutoField(... | 31.111111 | 114 | 0.583333 |
fe24fa6a6769a9b1801bf76760dbe392386f6963 | 15,181 | py | Python | ddpm/src/modules/models1.py | an-seunghwan/generative | edba5999677e80178f0a3ecd091f1800396ebcef | [
"MIT"
] | 6 | 2021-06-02T04:48:20.000Z | 2022-02-02T10:19:07.000Z | ddpm/src/modules/models1.py | an-seunghwan/generative | edba5999677e80178f0a3ecd091f1800396ebcef | [
"MIT"
] | null | null | null | ddpm/src/modules/models1.py | an-seunghwan/generative | edba5999677e80178f0a3ecd091f1800396ebcef | [
"MIT"
] | null | null | null | #%%
'''
Fixed:
tfa.layers.GroupNormalization(1) -> layers.LayerNormalization()
'''
#%%
import tensorflow as tf
import tensorflow.keras as K
from tensorflow.keras import layers
import numpy as np
# import tensorflow_addons as tfa
#%%
# def nonlinearity(x):
# return tf.nn.swish(x)
#%%
# # FIXME
# def normalize(x):
# ... | 42.643258 | 167 | 0.600883 |
a556b4fcb1cb8fe2debced0b417597ffb87d3059 | 2,882 | py | Python | blog/views.py | chiraag-kakar/My-Django-Blog | af4a56bd678cd0800473be718304c589f1b53904 | [
"MIT"
] | 5 | 2020-08-28T07:01:32.000Z | 2020-12-14T00:29:01.000Z | blog/views.py | Favy-source/My-BlogTask | dd6ed005f9a10f2d658a55c597c89cd0a65cbf3c | [
"MIT"
] | null | null | null | blog/views.py | Favy-source/My-BlogTask | dd6ed005f9a10f2d658a55c597c89cd0a65cbf3c | [
"MIT"
] | 4 | 2020-11-10T17:51:19.000Z | 2021-05-13T13:55:40.000Z | from django.shortcuts import render, get_object_or_404
from django.utils import timezone
from .models import Post, Comment
from django.shortcuts import redirect
from django.contrib.auth.decorators import login_required
from .forms import PostForm, CommentForm
def post_detail(request, pk):
post = get_object_or_40... | 32.75 | 94 | 0.672797 |
4db4af00edf4a7b4a446748ec68b0f4a38ef5e96 | 21,615 | py | Python | src/cobble/env.py | cbiffle/cobble-build | 8cd2bc1d03c1d41a2f25ae6b064ab6dafd6016e4 | [
"BSD-2-Clause"
] | 9 | 2015-09-08T14:35:40.000Z | 2021-09-27T23:24:19.000Z | src/cobble/env.py | oxidecomputer/cobble-build | e98052fd15d7718950155d595c6d8e07e3f4531e | [
"BSD-2-Clause"
] | 1 | 2021-01-07T01:53:22.000Z | 2021-11-03T13:18:24.000Z | src/cobble/env.py | cbiffle/cobble-build | 8cd2bc1d03c1d41a2f25ae6b064ab6dafd6016e4 | [
"BSD-2-Clause"
] | 2 | 2020-03-12T22:04:12.000Z | 2020-12-21T20:15:25.000Z | """Environments and supporting types.
An *environment* in Cobble is an immutable key-value mapping, similar to a
Python dict. The contents of environments are restricted, however, in two ways:
1. Each environment is associated with a `KeyRegistry`, and any key used in the
environment must be registered before use.... | 38.460854 | 82 | 0.622299 |
b655047b25f1797c56e017420180e441e6b5a021 | 5,614 | py | Python | packs/nagios/etc/st2service_handler.py | jonico/st2contrib | 149c9c553f24360d91a14fef7ea6146707de75fd | [
"Apache-2.0"
] | 5 | 2016-10-11T11:52:53.000Z | 2017-06-15T05:21:05.000Z | packs/nagios/etc/st2service_handler.py | jonico/st2contrib | 149c9c553f24360d91a14fef7ea6146707de75fd | [
"Apache-2.0"
] | 25 | 2016-07-28T17:50:35.000Z | 2017-09-25T09:26:18.000Z | packs/nagios/etc/st2service_handler.py | jonico/st2contrib | 149c9c553f24360d91a14fef7ea6146707de75fd | [
"Apache-2.0"
] | 2 | 2015-09-09T11:46:25.000Z | 2020-11-21T10:10:49.000Z | #!/usr/bin/env python
import httplib
try:
import simplejson as json
except ImportError:
import json
import os
import sys
from urlparse import urljoin
try:
import requests
except ImportError:
raise ImportError('Missing dependency requests. Do ``pip install requests``.')
try:
import yaml
except Imp... | 28.789744 | 92 | 0.636979 |
6c2262b4d65f8083f8456ce5ce012cb0dbd5f791 | 5,656 | py | Python | backstage/core/funcs.py | pyrustic/backstage | d0cead248235026129e3743d43c12691342701fc | [
"MIT"
] | null | null | null | backstage/core/funcs.py | pyrustic/backstage | d0cead248235026129e3743d43c12691342701fc | [
"MIT"
] | null | null | null | backstage/core/funcs.py | pyrustic/backstage | d0cead248235026129e3743d43c12691342701fc | [
"MIT"
] | null | null | null | import os
import os.path
import shutil
def get_app_pkg(project_dir):
"""
This function extracts the application package name from a project_dir path.
Basically it extracts the basename from the path then turns dashes "-" into
"underscores" "_".
Parameters:
- project_dir: str, path to the... | 26.805687 | 85 | 0.588048 |
59c1e9a1f818fed5d4fceed3bb333e8496da974e | 2,210 | py | Python | kale/wallet/puzzles/prefarm/make_prefarm_ph.py | inan0812/kale-blockchain | 1b502fe21a4be10b4db0171c3a7030079dcefa1b | [
"Apache-2.0"
] | null | null | null | kale/wallet/puzzles/prefarm/make_prefarm_ph.py | inan0812/kale-blockchain | 1b502fe21a4be10b4db0171c3a7030079dcefa1b | [
"Apache-2.0"
] | null | null | null | kale/wallet/puzzles/prefarm/make_prefarm_ph.py | inan0812/kale-blockchain | 1b502fe21a4be10b4db0171c3a7030079dcefa1b | [
"Apache-2.0"
] | null | null | null | from clvm.casts import int_from_bytes
from clvm_tools import binutils
from kale.consensus.block_rewards import calculate_base_farmer_reward, calculate_pool_reward
from kale.types.blockchain_format.program import Program
from kale.types.condition_opcodes import ConditionOpcode
from kale.util.bech32m import decode_puzzl... | 35.645161 | 114 | 0.730769 |
6e9cbdf25d0ed5712a32a27da07516d481a1313a | 497 | py | Python | submissions/abc170/c.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 1 | 2021-05-10T01:16:28.000Z | 2021-05-10T01:16:28.000Z | submissions/abc170/c.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 3 | 2021-05-11T06:14:15.000Z | 2021-06-19T08:18:36.000Z | submissions/abc170/c.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | null | null | null | def main():
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
x, n = map(int, readline().split())
p = list(map(int, readline().split()))
check = float('inf')
ans = 0
for i in range(1... | 22.590909 | 42 | 0.531187 |
6a4e77b481d87aa0d4c759ae681a0649d2628d5f | 465 | py | Python | env/lib/python3.8/site-packages/plotly/validators/cone/hoverlabel/font/_sizesrc.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/cone/hoverlabel/font/_sizesrc.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/cone/hoverlabel/font/_sizesrc.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class SizesrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(
self, plotly_name="sizesrc", parent_name="cone.hoverlabel.font", **kwargs
):
super(SizesrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name... | 31 | 81 | 0.636559 |
be34738bb59daabfd90ef0829f8cf3234ffe7527 | 421 | py | Python | addifintegers.py | manand881/Python-Programs | eb970cb1b21d4aede0102c60425eb8a1d4ac605c | [
"MIT"
] | null | null | null | addifintegers.py | manand881/Python-Programs | eb970cb1b21d4aede0102c60425eb8a1d4ac605c | [
"MIT"
] | null | null | null | addifintegers.py | manand881/Python-Programs | eb970cb1b21d4aede0102c60425eb8a1d4ac605c | [
"MIT"
] | null | null | null | # Add two objects if both objects are an integer type
import sys
def add_ints(a, b):
if type(a) == type(b) == int:
return a + b
else:
sys.exit
print(add_ints(1,2)) # ===> 3
print(add_ints(1,'2')) # ===> None
# def add_numbers(a, b):
# if not (isinstance(a, int) and isinstance(b, int)):
#... | 22.157895 | 57 | 0.586698 |
c371aefd75a154c71519efca1ad974c27e00d673 | 956 | py | Python | signac/common/errors.py | shandave/signac | 911d7eb1f475f501b2c21e47bbf00829a958147a | [
"BSD-3-Clause"
] | null | null | null | signac/common/errors.py | shandave/signac | 911d7eb1f475f501b2c21e47bbf00829a958147a | [
"BSD-3-Clause"
] | 106 | 2020-06-11T19:44:35.000Z | 2022-03-01T13:01:09.000Z | signac/common/errors.py | daico007/signac | a20d815bd87af3d8992c71871071024062cada07 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2017 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
"""Errors raised by signac.common classes."""
from ..core.errors import Error
class ConfigError(Error, RuntimeError):
"""Error with parsing or reading a configuration f... | 25.837838 | 80 | 0.697699 |
eaa97f8c79bd04025e6c211373e028ba5f3b1146 | 2,471 | py | Python | discord/state.py | nextcord-ext/nextcord | 7b3022ae19299e1f40f5f34da33b80ae491aa06a | [
"MIT"
] | null | null | null | discord/state.py | nextcord-ext/nextcord | 7b3022ae19299e1f40f5f34da33b80ae491aa06a | [
"MIT"
] | null | null | null | discord/state.py | nextcord-ext/nextcord | 7b3022ae19299e1f40f5f34da33b80ae491aa06a | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
Copyright (c) 2021-present tag-epic
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
t... | 23.990291 | 78 | 0.717928 |
5cf33cd241e4c8aa395c08940cce8e71799fdd61 | 23,795 | py | Python | Packs/MailListener/Integrations/MailListenerV2/MailListenerV2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/MailListener/Integrations/MailListenerV2/MailListenerV2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/MailListener/Integrations/MailListenerV2/MailListenerV2.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z | import ssl
from datetime import timezone
from typing import Any, Dict, Tuple, List, Optional
from dateparser import parse
from mailparser import parse_from_bytes
from imap_tools import OR
from imapclient import IMAPClient
import demistomock as demisto
from CommonServerPython import *
class Email(object):
def __... | 46.384016 | 125 | 0.624837 |
923981d45eada08a99e1be05199a0c9e8d63807b | 3,305 | py | Python | django-hosting-heroku/source_code_step_8/portfolio-project/portfolio/settings.py | syberflea/materials | 54f44725b40edf00c1b523d7a85b34a85014d7eb | [
"MIT"
] | 3,682 | 2018-05-07T19:45:24.000Z | 2022-03-31T15:19:10.000Z | django-hosting-heroku/source_code_step_8/portfolio-project/portfolio/settings.py | sribarrow/materials | c17c4a4d6f8487e59eac1df8c88ca92b73d6d2a5 | [
"MIT"
] | 148 | 2018-05-15T21:18:49.000Z | 2022-03-21T11:25:39.000Z | django-hosting-heroku/source_code_step_8/portfolio-project/portfolio/settings.py | sribarrow/materials | c17c4a4d6f8487e59eac1df8c88ca92b73d6d2a5 | [
"MIT"
] | 5,535 | 2018-05-25T23:36:08.000Z | 2022-03-31T16:55:52.000Z | """
Django settings for portfolio project.
Generated by 'django-admin startproject' using Django 3.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathl... | 25.620155 | 91 | 0.70348 |
678cb203c531e84262cace95f461490fb246560f | 1,034 | py | Python | nlp/text_processing.py | innaiivanova/chatbot | 03ed98dfc24b36620db96094e8970a48010a9379 | [
"MIT"
] | null | null | null | nlp/text_processing.py | innaiivanova/chatbot | 03ed98dfc24b36620db96094e8970a48010a9379 | [
"MIT"
] | null | null | null | nlp/text_processing.py | innaiivanova/chatbot | 03ed98dfc24b36620db96094e8970a48010a9379 | [
"MIT"
] | null | null | null | # Codecademy's text processing
# Inna I. Ivanova
# regex for removing punctuation!
import re
# nltk preprocessing magic
import nltk
from nltk.tokenize import word_tokenize
from nltk.stem import PorterStemmer
from nltk.stem import WordNetLemmatizer
# grabbing a part of speech function:
from part_of_speech import get_pa... | 34.466667 | 310 | 0.779497 |
a6f95160a321b5ee7ecf20688e9f38ec4cc42de6 | 574 | py | Python | otcore/hit/migrations/0006_auto_20160520_1810.py | NYULibraries/dlts-enm-tct-backend | 07455a660fb2cb8bc91a54f7f12d150923678157 | [
"Apache-2.0"
] | null | null | null | otcore/hit/migrations/0006_auto_20160520_1810.py | NYULibraries/dlts-enm-tct-backend | 07455a660fb2cb8bc91a54f7f12d150923678157 | [
"Apache-2.0"
] | 2 | 2017-10-30T21:19:07.000Z | 2017-10-31T18:06:30.000Z | otcore/hit/migrations/0006_auto_20160520_1810.py | NYULibraries/dlts-enm-tct-backend | 07455a660fb2cb8bc91a54f7f12d150923678157 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-05-20 22:10
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('hit', '0005_auto_20160519_1412'),
]
operations = [
... | 26.090909 | 148 | 0.65331 |
7f4c27af05ccdd9010728e67532f5c8a7b28c57e | 57 | py | Python | tia/analysis/__init__.py | AmarisAI/tia | a7043b6383e557aeea8fc7112bbffd6e36a230e9 | [
"BSD-3-Clause"
] | 366 | 2015-01-21T21:57:23.000Z | 2022-03-29T09:11:24.000Z | tia/analysis/__init__.py | AmarisAI/tia | a7043b6383e557aeea8fc7112bbffd6e36a230e9 | [
"BSD-3-Clause"
] | 51 | 2015-03-01T14:20:44.000Z | 2021-08-19T15:46:51.000Z | tia/analysis/__init__.py | AmarisAI/tia | a7043b6383e557aeea8fc7112bbffd6e36a230e9 | [
"BSD-3-Clause"
] | 160 | 2015-02-22T07:16:17.000Z | 2022-03-29T13:41:15.000Z | import tia.analysis.perf
from tia.analysis.model import * | 28.5 | 32 | 0.824561 |
512f8877613a414c7394fc69ec1ec1bffcc0907d | 451 | py | Python | config.py | VigneshTirukkonda/dig1ts | 3b3ca56863f974a5386e9dad5acf8d909e5086db | [
"MIT"
] | null | null | null | config.py | VigneshTirukkonda/dig1ts | 3b3ca56863f974a5386e9dad5acf8d909e5086db | [
"MIT"
] | null | null | null | config.py | VigneshTirukkonda/dig1ts | 3b3ca56863f974a5386e9dad5acf8d909e5086db | [
"MIT"
] | null | null | null |
# TRAIN_PATH = '/Users/roshantirukkonda/Desktop/Kaggle /Pytorch CNN MNIST/Input/MNIST/processed/training.pt'
# TEST_PATH = '/Users/roshantirukkonda/Desktop/Kaggle /Pytorch CNN MNIST/Input/MNIST/processed/test.pt'
ROOT = '../Input'
MODEL_PATH = '../Input/Model'
LATEST_MODEL = '/CNN-2021-02-26 02:47:01.247436.pt'
TES... | 23.736842 | 108 | 0.718404 |
aa28f5725222cf0ad073b343b15ec3efb7d2772d | 9,021 | py | Python | opsi/modules/color.py | frcmi/opensight | 3b0c0c63a877f739a1ee8261a9befbb44a3b7796 | [
"MIT"
] | 48 | 2019-09-22T07:08:35.000Z | 2022-01-15T16:19:42.000Z | opsi/modules/color.py | frcmi/opensight | 3b0c0c63a877f739a1ee8261a9befbb44a3b7796 | [
"MIT"
] | 16 | 2019-10-02T18:48:59.000Z | 2020-12-06T04:23:03.000Z | opsi/modules/color.py | frcmi/opensight | 3b0c0c63a877f739a1ee8261a9befbb44a3b7796 | [
"MIT"
] | 11 | 2019-09-19T15:57:06.000Z | 2020-08-12T01:08:44.000Z | from dataclasses import dataclass
import cv2
import numpy as np
from opsi.manager.manager_schema import Function
from opsi.manager.types import RangeType, Slide
from opsi.util.cv import Mat, MatBW
from opsi.util.cv.mat import Color
from opsi.util.cv.shape import Point
__package__ = "opsi.colorops"
__version__ = "0.1... | 24.580381 | 102 | 0.567232 |
89b9a597f059384e4295580394d81233e493f88b | 8,547 | py | Python | sfdx.py | iechenybsh/exiahuangl | 6834ec0d40a53ece3c0ff738c5b728616da26a02 | [
"Apache-2.0"
] | 29 | 2016-12-15T07:14:44.000Z | 2022-03-17T17:24:08.000Z | sfdx.py | iechenybsh/exiahuangl | 6834ec0d40a53ece3c0ff738c5b728616da26a02 | [
"Apache-2.0"
] | 5 | 2017-02-14T02:04:44.000Z | 2019-02-19T19:25:22.000Z | sfdx.py | iechenybsh/exiahuangl | 6834ec0d40a53ece3c0ff738c5b728616da26a02 | [
"Apache-2.0"
] | 12 | 2016-12-16T08:02:45.000Z | 2020-02-20T00:00:58.000Z | import sublime
import sublime_plugin
import os, re
import json
from .setting import SfBasicConfig
from .uiutil import SublConsole
from . import util
SFDX_SETTINGS = "sfdx.sublime-settings"
class OpenSfdxSettingCommand(sublime_plugin.WindowCommand):
def run(self):
SETTING_PATH = os.path.join(sublime.packag... | 37 | 145 | 0.558676 |
4336218e01685ceb7ebf5eb61a177f01229df672 | 3,914 | py | Python | core/settings.py | piyushjain-pj/pneumonia_and_covid_prediction_tool | b5f503b1672b1093c4bd6f9e053d6024e4f73f9d | [
"MIT"
] | 1 | 2022-03-30T15:28:33.000Z | 2022-03-30T15:28:33.000Z | core/settings.py | piyushjain-pj/pneumonia_and_covid_prediction_tool | b5f503b1672b1093c4bd6f9e053d6024e4f73f9d | [
"MIT"
] | null | null | null | core/settings.py | piyushjain-pj/pneumonia_and_covid_prediction_tool | b5f503b1672b1093c4bd6f9e053d6024e4f73f9d | [
"MIT"
] | null | null | null | import os
from decouple import config
from unipath import Path
import dj_database_url
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = Path(__file__).parent
CORE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# SECURITY WARNING: keep the secret key used in producti... | 29.428571 | 91 | 0.664027 |
197fc8950e489be9f03d27ae2510032afa686787 | 18,818 | py | Python | log_complete/model_301.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete/model_301.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete/model_301.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 91.349515 | 710 | 0.806515 |
845186054481ceeb5aae3fd8684349ac61f5aa77 | 4,490 | py | Python | NeoCL/models/pretrained.py | NizarIslah/NeocorticalCL | a0f5cbf863329af9ae752b87f15958105d2c354f | [
"Apache-2.0"
] | null | null | null | NeoCL/models/pretrained.py | NizarIslah/NeocorticalCL | a0f5cbf863329af9ae752b87f15958105d2c354f | [
"Apache-2.0"
] | null | null | null | NeoCL/models/pretrained.py | NizarIslah/NeocorticalCL | a0f5cbf863329af9ae752b87f15958105d2c354f | [
"Apache-2.0"
] | null | null | null | import torch
from torch import nn
from avalanche.models import IncrementalClassifier
from avalanche.training import ICaRL
from torch.nn import Linear, ReLU, MultiheadAttention, Sequential
import clip
from torchvision import datasets
from collections import defaultdict, deque
import itertools
class SSLIcarl(nn.Modu... | 37.416667 | 108 | 0.659465 |
1d8f3420130ce81dbc9f1aa684e9bd0ab519acae | 1,191 | py | Python | sharer/templatetags/sharer_tags.py | taylanpince/django-sharer | 91e9bf5aa7b723540f7b248fdf7051a21276eb88 | [
"Apache-2.0"
] | 2 | 2016-05-09T09:06:06.000Z | 2018-02-26T22:35:09.000Z | sharer/templatetags/sharer_tags.py | taylanpince/django-sharer | 91e9bf5aa7b723540f7b248fdf7051a21276eb88 | [
"Apache-2.0"
] | null | null | null | sharer/templatetags/sharer_tags.py | taylanpince/django-sharer | 91e9bf5aa7b723540f7b248fdf7051a21276eb88 | [
"Apache-2.0"
] | null | null | null | from urlparse import urljoin
from django import template
from django.contrib.sites.models import Site
from django.template.defaultfilters import urlencode
from sharer.forms import EmailShareForm
from sharer.models import SocialNetwork
from sharer.settings import ENABLE_EMAILS
register = template.Library()
@regist... | 23.82 | 74 | 0.641478 |
586dc23d21369820a578645e0cb5204786dadb0c | 1,750 | py | Python | nuremberg/core/management/commands/audit_joins.py | emmalemma/nuremberg | 10a5f789f5668aa4e7902e1765737c2c764ff2b2 | [
"MIT"
] | 3 | 2016-06-27T17:31:24.000Z | 2021-08-10T17:56:49.000Z | nuremberg/core/management/commands/audit_joins.py | emmalemma/nuremberg | 10a5f789f5668aa4e7902e1765737c2c764ff2b2 | [
"MIT"
] | 43 | 2016-06-19T14:54:20.000Z | 2021-01-22T19:57:38.000Z | nuremberg/core/management/commands/audit_joins.py | emmalemma/nuremberg | 10a5f789f5668aa4e7902e1765737c2c764ff2b2 | [
"MIT"
] | 6 | 2016-05-24T06:06:53.000Z | 2021-03-12T19:40:42.000Z | from django.core.management.base import BaseCommand
from nuremberg.transcripts.models import Transcript
from nuremberg.transcripts.xml import TranscriptPageJoiner
class Command(BaseCommand):
help = 'Joins transcript pages and outputs a log of all joins made.'
def add_arguments(self, parser):
parser.a... | 35.714286 | 124 | 0.614286 |
a40bf93a7c008dd732e748cb033ed1a039197bc9 | 2,045 | py | Python | shop/migrations/0001_initial.py | Slohn/myshop | 4e5034dc3b1561773060319f16628d44910c4a20 | [
"MIT"
] | 20 | 2021-05-07T19:32:56.000Z | 2022-02-06T12:12:56.000Z | shop/migrations/0001_initial.py | Slohn/myshop | 4e5034dc3b1561773060319f16628d44910c4a20 | [
"MIT"
] | 9 | 2021-04-08T18:29:18.000Z | 2022-03-11T23:28:23.000Z | shop/migrations/0001_initial.py | Slohn/myshop | 4e5034dc3b1561773060319f16628d44910c4a20 | [
"MIT"
] | 10 | 2021-02-22T13:50:24.000Z | 2022-03-15T11:51:27.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-11-27 07:15
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Cre... | 37.87037 | 138 | 0.554034 |
7c81cf8310b0c97adc1faf4c7cbd79981254d120 | 24,505 | py | Python | DP/Server/utils.py | apanagopoulos/XBOS-DR | 80e186d691bf17c244b1e87ccb5c2356155748e5 | [
"Apache-2.0"
] | null | null | null | DP/Server/utils.py | apanagopoulos/XBOS-DR | 80e186d691bf17c244b1e87ccb5c2356155748e5 | [
"Apache-2.0"
] | 25 | 2018-05-11T19:15:16.000Z | 2018-08-09T03:11:28.000Z | DP/Server/utils.py | apanagopoulos/XBOS-DR | 80e186d691bf17c244b1e87ccb5c2356155748e5 | [
"Apache-2.0"
] | 3 | 2017-10-23T18:47:15.000Z | 2018-08-20T16:41:18.000Z | # this is the plotter for the MPC graph
import datetime
import os
import string
import numpy as np
import pandas as pd
import plotly.graph_objs as go
import pytz
import yaml
from xbos import get_client
from xbos.devices.thermostat import Thermostat
# be careful of circular import.
# https://stackoverflow.com/questio... | 35.057225 | 131 | 0.599674 |
6e5cf966d85759af33becbcccfecc7f0866697b8 | 2,297 | py | Python | Implementation_NN/3_nn_XOR_gate_visualization.py | bikashsingh0/neural_network_scratch | c5db50e75dc0216f9b5bed0f2e48f51e2e370bde | [
"MIT"
] | 1 | 2019-07-04T05:54:00.000Z | 2019-07-04T05:54:00.000Z | Implementation_NN/3_nn_XOR_gate_visualization.py | bikashsingh0/neural_network_scratch | c5db50e75dc0216f9b5bed0f2e48f51e2e370bde | [
"MIT"
] | null | null | null | Implementation_NN/3_nn_XOR_gate_visualization.py | bikashsingh0/neural_network_scratch | c5db50e75dc0216f9b5bed0f2e48f51e2e370bde | [
"MIT"
] | null | null | null | #!/bin/python3
import sys
import random
import numpy as np
sys.path.append('..')
from neural_network import NeuralNetwork
import time
from tkinter import *
tk = Tk()
widthSize = 500
heightSize = 500
frameRate = 60
frameSpeed = int(1 / frameRate * 1000)
canvas = Canvas(tk, width=widthSize, height=heightSize, backgrou... | 29.831169 | 123 | 0.594689 |
24d99a7ff3efffe5d3e4927117078f1d35e3d087 | 24 | py | Python | splunk_sdk/__version__.py | ahallur/splunk-cloud-sdk-python | 27914e4cb624bcc67788408688553cfb99f64aa1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | splunk_sdk/__version__.py | ahallur/splunk-cloud-sdk-python | 27914e4cb624bcc67788408688553cfb99f64aa1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | splunk_sdk/__version__.py | ahallur/splunk-cloud-sdk-python | 27914e4cb624bcc67788408688553cfb99f64aa1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | __version__ = '1.0.0b4'
| 12 | 23 | 0.666667 |
1df50163d986d9a7745847149100d8e31050f894 | 265 | py | Python | chandler/run.py | jenlaiwong/ColorNets | 6b976f0b3e09ab7478691d9cc8d37b35d2885175 | [
"MIT"
] | null | null | null | chandler/run.py | jenlaiwong/ColorNets | 6b976f0b3e09ab7478691d9cc8d37b35d2885175 | [
"MIT"
] | null | null | null | chandler/run.py | jenlaiwong/ColorNets | 6b976f0b3e09ab7478691d9cc8d37b35d2885175 | [
"MIT"
] | null | null | null | import pickle
import numpy as np
#### Setup
# read W1 W2 history if it exists, otherwise pick random and write
# read x and y from inputs and write them to files
weight_history (append only)
(read only)
[Xy1, Xy2, ..]
# thread concurrent
run multi processes
| 14.722222 | 66 | 0.728302 |
8d022e2ab3b59eb45a360c5573f74da1e0051beb | 3,962 | py | Python | ion/cache.py | bamaxw/ion | a04b7d6b05cc606e821d52bbdbb7fe080742134f | [
"MIT"
] | 1 | 2019-04-29T15:13:33.000Z | 2019-04-29T15:13:33.000Z | ion/cache.py | bamaxw/ion | a04b7d6b05cc606e821d52bbdbb7fe080742134f | [
"MIT"
] | null | null | null | ion/cache.py | bamaxw/ion | a04b7d6b05cc606e821d52bbdbb7fe080742134f | [
"MIT"
] | null | null | null | '''Functions and classes helping with application-level caching and memoization'''
from typing import Callable, Any, Optional
from functools import wraps, partial
from collections import namedtuple
import time
TsValue = namedtuple('TsValue', ['value', 'timestamp'])
class MemoizeWithTimeout:
'''
Use this clas... | 36.018182 | 116 | 0.626704 |
0052373d155a064be733051034f056b081f27b0b | 9,550 | py | Python | cinder/tests/unit/api/v2/fakes.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/api/v2/fakes.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | 2 | 2018-10-25T13:04:01.000Z | 2019-08-17T13:15:24.000Z | cinder/tests/unit/api/v2/fakes.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | 2 | 2018-10-17T13:32:50.000Z | 2018-11-08T08:39:39.000Z | # Copyright 2010 OpenStack Foundation
# 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 requ... | 36.174242 | 78 | 0.638953 |
9da38c6aaaf52bf08d090cd5a6861aa0013d608e | 4,907 | py | Python | python/mxnet/rtc.py | Najah-lshanableh/Deep_learning | 4b8235bdacd319843dda7b331f207808e4a90a93 | [
"Apache-2.0"
] | 4 | 2017-11-17T07:28:09.000Z | 2019-07-23T06:24:16.000Z | python/mxnet/rtc.py | Najah-lshanableh/Deep_learning | 4b8235bdacd319843dda7b331f207808e4a90a93 | [
"Apache-2.0"
] | null | null | null | python/mxnet/rtc.py | Najah-lshanableh/Deep_learning | 4b8235bdacd319843dda7b331f207808e4a90a93 | [
"Apache-2.0"
] | 2 | 2019-06-12T12:40:20.000Z | 2020-11-03T14:33:14.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... | 45.018349 | 95 | 0.560016 |
5365252bc3441061bd5480afc3dcb18a728825e6 | 4,244 | py | Python | packaging/setup/plugins/ovirt-engine-common/base/remote_engine/remote_engine_manual_files.py | UranusBlockStack/ovirt-engine | fe3c90ed3e74e6af9497c826c82e653382946ae1 | [
"Apache-2.0"
] | null | null | null | packaging/setup/plugins/ovirt-engine-common/base/remote_engine/remote_engine_manual_files.py | UranusBlockStack/ovirt-engine | fe3c90ed3e74e6af9497c826c82e653382946ae1 | [
"Apache-2.0"
] | null | null | null | packaging/setup/plugins/ovirt-engine-common/base/remote_engine/remote_engine_manual_files.py | UranusBlockStack/ovirt-engine | fe3c90ed3e74e6af9497c826c82e653382946ae1 | [
"Apache-2.0"
] | null | null | null | #
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2014-2015 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | 29.472222 | 77 | 0.542884 |
e72f5bc0e759f4053138ce8a20675e9c783b8ace | 9,572 | py | Python | ynab_client/api/scheduled_transactions_api.py | Pezmc/ynab-client-python | 6d154f3efecef6a5c3ff1cf89d8a2a59f9f7bb97 | [
"Apache-2.0"
] | 4 | 2018-12-02T19:55:40.000Z | 2021-02-28T13:13:45.000Z | ynab_client/api/scheduled_transactions_api.py | Pezmc/ynab-client-python | 6d154f3efecef6a5c3ff1cf89d8a2a59f9f7bb97 | [
"Apache-2.0"
] | 10 | 2018-07-22T06:52:16.000Z | 2022-01-09T14:05:49.000Z | ynab_client/api/scheduled_transactions_api.py | Pezmc/ynab-client-python | 6d154f3efecef6a5c3ff1cf89d8a2a59f9f7bb97 | [
"Apache-2.0"
] | 10 | 2018-09-11T01:01:44.000Z | 2022-01-09T13:54:50.000Z | # coding: utf-8
"""
YNAB API Endpoints
Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.youneedabudge... | 41.081545 | 294 | 0.643962 |
14fc6f2abfd17641e1e0bc7d0033e17f9c61bbcd | 1,152 | py | Python | drf/drf_crud/app/views.py | taptorestart/python-backend-examples | 0817223f403570f5822511c240726c6108d3b9b7 | [
"MIT"
] | 7 | 2022-02-25T03:27:01.000Z | 2022-03-22T10:51:13.000Z | drf/drf_crud/app/views.py | taptorestart/python-backend-examples | 0817223f403570f5822511c240726c6108d3b9b7 | [
"MIT"
] | null | null | null | drf/drf_crud/app/views.py | taptorestart/python-backend-examples | 0817223f403570f5822511c240726c6108d3b9b7 | [
"MIT"
] | 1 | 2022-03-24T14:47:49.000Z | 2022-03-24T14:47:49.000Z | from django.contrib.auth.models import User, Group
from rest_framework import viewsets
from rest_framework import permissions
from app.serializers import UserSerializer, GroupSerializer, CategorySerializer, BeverageSerializer
from app.models import Category, Beverage
class UserViewSet(viewsets.ModelViewSet):
quer... | 36 | 99 | 0.773438 |
4fd33886c3fdafce581c2aa3e123cbef9dd16ba0 | 2,731 | py | Python | python-博客网站内容爬取/PyCharm_article/com/article/spider/m_baidu.py | wangchuanli001/Project-experience | b563c5c3afc07c913c2e1fd25dff41c70533f8de | [
"Apache-2.0"
] | 12 | 2019-12-07T01:44:55.000Z | 2022-01-27T14:13:30.000Z | python-博客网站内容爬取/PyCharm_article/com/article/spider/m_baidu.py | hujiese/Project-experience | b563c5c3afc07c913c2e1fd25dff41c70533f8de | [
"Apache-2.0"
] | 23 | 2020-05-23T03:56:33.000Z | 2022-02-28T07:54:45.000Z | python-博客网站内容爬取/PyCharm_article/com/article/spider/m_baidu.py | hujiese/Project-experience | b563c5c3afc07c913c2e1fd25dff41c70533f8de | [
"Apache-2.0"
] | 7 | 2019-12-20T04:48:56.000Z | 2021-11-19T02:23:45.000Z | # -*- coding: utf-8 -*-
import socket
import threading
import jieba
import requests
from bs4 import BeautifulSoup
import urllib.request
import random
import time
import sql_operation
import ast
import sys
import codecs
def page_html(keyword):
print('\n当前关键字 : ' + keyword)
socket.setdefaulttimeout(10) # 设置全局... | 34.56962 | 144 | 0.586964 |
71bc65b20e9bba97fada7a826bc4cbe7dc2080bd | 78 | py | Python | sancus/lib/cogs/games/__init__.py | Solar-Productions/sancus | eb3c5c702bc5574c62b488c0e3bb06a36159e651 | [
"Apache-2.0"
] | 1 | 2021-09-03T22:52:27.000Z | 2021-09-03T22:52:27.000Z | sancus/lib/cogs/games/__init__.py | LunarDevelop/sancus | eb3c5c702bc5574c62b488c0e3bb06a36159e651 | [
"Apache-2.0"
] | 1 | 2021-10-10T22:11:51.000Z | 2021-10-10T22:11:51.000Z | sancus/lib/cogs/games/__init__.py | Solar-Productions/sancus | eb3c5c702bc5574c62b488c0e3bb06a36159e651 | [
"Apache-2.0"
] | 1 | 2021-11-11T16:04:02.000Z | 2021-11-11T16:04:02.000Z | from .games import Games
def setup(client):
client.add_cog(Games(client)) | 19.5 | 33 | 0.74359 |
54e5e3dd9be57419f29e832916ea7f8449b510b7 | 481 | py | Python | conv_mechanics/tip.py | devinmcgloin/advent-term | 96fd3ca408b3437518830e354ea3ccfa790fd191 | [
"Apache-2.0"
] | null | null | null | conv_mechanics/tip.py | devinmcgloin/advent-term | 96fd3ca408b3437518830e354ea3ccfa790fd191 | [
"Apache-2.0"
] | 38 | 2019-05-29T10:17:00.000Z | 2020-02-20T05:35:41.000Z | conv_mechanics/tip.py | devinmcgloin/advent-term | 96fd3ca408b3437518830e354ea3ccfa790fd191 | [
"Apache-2.0"
] | null | null | null | """
utility functions to determine if a command is a tip or not.
"""
import re
is_tip_regex = re.compile("^tip *\$?(?:0|[1-9]\d{0,2}(?:,?\d{3})*)(?:\.\d+)?$")
amount_regex = re.compile("-?(?:0|[1-9]\d{0,2}(?:,?\d{3})*)(?:\.\d+)?$")
def is_tip(user_response):
if re.match(is_tip_regex, user_response) is not None:... | 24.05 | 79 | 0.615385 |
f0440ee7e2ae41df976f5a4dfb451d768828056a | 4,806 | py | Python | src/benchmark/api/api_lxd.py | edvgui/LEPL2990-Benchmark-tool | be9bf7e62be215ec14ee5fddb91166bb8861090e | [
"MIT"
] | 3 | 2020-06-11T18:33:27.000Z | 2021-02-21T13:48:06.000Z | src/benchmark/api/api_lxd.py | edvgui/LEPL2990-Benchmark-tool | be9bf7e62be215ec14ee5fddb91166bb8861090e | [
"MIT"
] | null | null | null | src/benchmark/api/api_lxd.py | edvgui/LEPL2990-Benchmark-tool | be9bf7e62be215ec14ee5fddb91166bb8861090e | [
"MIT"
] | null | null | null | import subprocess
import time
from exceptions.api_exception import ApiException
class LXCApiException(ApiException):
def __init__(self, message, trace):
super().__init__("LXD", message, trace)
def init(image, flags, log=False):
"""
Initialize a container from an image with the command 'lxc ini... | 36.687023 | 120 | 0.644611 |
2151d16e4ba443ed253c42ec4900aa5ed92328b2 | 2,709 | py | Python | pygments/lexers/maxima.py | blu-base/pygments | da799d14818ed538bf937684a19ce779ddde9446 | [
"BSD-2-Clause"
] | 1 | 2015-06-08T14:52:49.000Z | 2015-06-08T14:52:49.000Z | pygments/lexers/maxima.py | blu-base/pygments | da799d14818ed538bf937684a19ce779ddde9446 | [
"BSD-2-Clause"
] | 1 | 2022-03-13T09:17:24.000Z | 2022-03-13T09:18:02.000Z | pygments/lexers/maxima.py | blu-base/pygments | da799d14818ed538bf937684a19ce779ddde9446 | [
"BSD-2-Clause"
] | null | null | null | """
pygments.lexers.maxima
~~~~~~~~~~~~~~~~~~~~~~
Lexer for the computer algebra system Maxima.
Derived from pygments/lexers/algebra.py.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexL... | 31.870588 | 94 | 0.444075 |
b93cfb83ea1e7bf35848c852073094a4cb16e8fa | 860 | py | Python | app/tasks.py | janist7/mangarso.com | 74210c604b27084213b519a28ffae6f01e552900 | [
"MIT"
] | null | null | null | app/tasks.py | janist7/mangarso.com | 74210c604b27084213b519a28ffae6f01e552900 | [
"MIT"
] | null | null | null | app/tasks.py | janist7/mangarso.com | 74210c604b27084213b519a28ffae6f01e552900 | [
"MIT"
] | null | null | null | from flask import render_template
from app.extensions import celery, mail
from app.database import db
from celery.signals import task_postrun
from flask_mail import Message
# Sends registration e-mail
@celery.task
def send_registration_email(user, email, token):
msg = Message(
'User Registration',
... | 28.666667 | 75 | 0.70814 |
d6f16c0740c6dd87a72267780993621baa27bc18 | 9,499 | py | Python | tests/test_batch/test_batch_cloudformation.py | cprimera/moto | 64e16d970ac5ec5c6887ac0c5478f0bb31f4fd8a | [
"Apache-2.0"
] | null | null | null | tests/test_batch/test_batch_cloudformation.py | cprimera/moto | 64e16d970ac5ec5c6887ac0c5478f0bb31f4fd8a | [
"Apache-2.0"
] | null | null | null | tests/test_batch/test_batch_cloudformation.py | cprimera/moto | 64e16d970ac5ec5c6887ac0c5478f0bb31f4fd8a | [
"Apache-2.0"
] | null | null | null | import boto3
import sure # noqa # pylint: disable=unused-import
from moto import (
mock_batch,
mock_iam,
mock_ec2,
mock_ecs,
mock_cloudformation,
)
import json
from uuid import uuid4
DEFAULT_REGION = "eu-central-1"
def _get_clients():
return (
boto3.client("ec2", region_name=DEFAULT_... | 34.292419 | 86 | 0.536583 |
cfd7d58d574fc2568d47b387697f63a5b30b595d | 3,367 | py | Python | tests/integration/test_dictionaries_dependency_xml/test.py | athom/ClickHouse | 4f4cc9d7404fd489a7229633b22b5ea1889bd8c0 | [
"Apache-2.0"
] | 3 | 2019-06-27T08:59:08.000Z | 2021-09-03T02:38:02.000Z | tests/integration/test_dictionaries_dependency_xml/test.py | athom/ClickHouse | 4f4cc9d7404fd489a7229633b22b5ea1889bd8c0 | [
"Apache-2.0"
] | 1 | 2021-06-28T15:03:05.000Z | 2021-06-28T15:03:05.000Z | tests/integration/test_dictionaries_dependency_xml/test.py | athom/ClickHouse | 4f4cc9d7404fd489a7229633b22b5ea1889bd8c0 | [
"Apache-2.0"
] | 1 | 2022-01-11T05:56:58.000Z | 2022-01-11T05:56:58.000Z | import pytest
from helpers.cluster import ClickHouseCluster
from helpers.test_tools import assert_eq_with_retry
DICTIONARY_FILES = ['configs/dictionaries/dep_x.xml', 'configs/dictionaries/dep_y.xml',
'configs/dictionaries/dep_z.xml']
cluster = ClickHouseCluster(__file__)
instance = cluster.add_ins... | 44.302632 | 117 | 0.656371 |
5f83efff1d75c76926f4585ad91043d7b71293e6 | 213 | py | Python | vehicle-counting-and-classification-opencv-master/soc.py | pb-10/Trafix | 5bb5d6de44be9bf65a3e245467c0176ae5e2e3d5 | [
"MIT"
] | 1 | 2019-10-07T04:41:58.000Z | 2019-10-07T04:41:58.000Z | vehicle-counting-and-classification-opencv-master/soc.py | DaScientist/Trafix | 5bb5d6de44be9bf65a3e245467c0176ae5e2e3d5 | [
"MIT"
] | null | null | null | vehicle-counting-and-classification-opencv-master/soc.py | DaScientist/Trafix | 5bb5d6de44be9bf65a3e245467c0176ae5e2e3d5 | [
"MIT"
] | 1 | 2019-10-07T04:42:08.000Z | 2019-10-07T04:42:08.000Z | import socket
s=socket.socket()
print("success")
port=8080
s.bind(('',port))
print("socket binded to %s" %(port))
s.listen(1)
print("listening")
c, addr = s.accept()
print("got connection")
c.close() | 16.384615 | 37 | 0.638498 |
d5754ee0684e7607b3f0e683cf70074d8bd9b64b | 2,069 | py | Python | src/models/AlexNet.py | AdrienVerdier/ProjetIFT780 | c699449d735f5df3314d2cd5143974a745560289 | [
"MIT"
] | null | null | null | src/models/AlexNet.py | AdrienVerdier/ProjetIFT780 | c699449d735f5df3314d2cd5143974a745560289 | [
"MIT"
] | null | null | null | src/models/AlexNet.py | AdrienVerdier/ProjetIFT780 | c699449d735f5df3314d2cd5143974a745560289 | [
"MIT"
] | null | null | null | """
Projet de session IFT780
Date:
Authors: Alexandre Turpin, Quentin Levieux and Adrien Verdier
License: Opensource, free to use
Other: This File represent the AlexNet Model
"""
import torch
import torch.nn as nn
import torch.nn.functional as F
from src.models.CNNBlocks import ConvBlock
class AlexNet(nn.Module):
... | 26.87013 | 76 | 0.569357 |
785601586704ef9cfca4aa8a158dbb0e6725aabd | 2,133 | py | Python | forte/utils.py | huzecong/forte | beae4e923c9a6873b582588972e6ec9919079271 | [
"Apache-2.0"
] | null | null | null | forte/utils.py | huzecong/forte | beae4e923c9a6873b582588972e6ec9919079271 | [
"Apache-2.0"
] | null | null | null | forte/utils.py | huzecong/forte | beae4e923c9a6873b582588972e6ec9919079271 | [
"Apache-2.0"
] | null | null | null | """
Util functions
"""
from pydoc import locate
__all__ = [
"get_full_module_name",
"get_class_name",
"get_class",
"get_qual_name",
]
def get_full_module_name(o, lower=False):
"""
Returns the full module and class name of an object o.
For example, for our :class: OntonotesReader, returns
... | 25.094118 | 78 | 0.614158 |
24266b2591436a5f6a532571b9070945626d7569 | 1,844 | py | Python | btoandav20/commissions/oandav20comm.py | josipbudzaki/btoandav20 | f6b7db07e37ed0d97df8a9c2337ce4b7e5953f56 | [
"Apache-2.0"
] | 60 | 2018-03-01T20:55:40.000Z | 2020-08-24T13:13:42.000Z | btoandav20/commissions/oandav20comm.py | josipbudzaki/btoandav20 | f6b7db07e37ed0d97df8a9c2337ce4b7e5953f56 | [
"Apache-2.0"
] | 54 | 2018-03-02T14:14:23.000Z | 2020-08-18T12:09:35.000Z | btoandav20/commissions/oandav20comm.py | josipbudzaki/btoandav20 | f6b7db07e37ed0d97df8a9c2337ce4b7e5953f56 | [
"Apache-2.0"
] | 33 | 2018-07-10T00:56:21.000Z | 2020-07-28T12:56:44.000Z | from backtrader.comminfo import CommInfoBase
class OandaV20BacktestCommInfo(CommInfoBase):
params = dict(
spread=0.0,
acc_counter_currency=True,
pip_location=-4,
margin=0.5,
leverage=20.0,
stocklike=False,
commtype=CommInfoBase.COMM_FIXED,
)
def __... | 35.461538 | 85 | 0.596529 |
ce5d3418e34186ca5ac4a843e3744a42ed1ecdd6 | 3,712 | py | Python | contrib/macdeploy/custom_dsstore.py | VsyncCrypto/stakecube | bff96b4622b8fcfe1e767c252ceaf54c10d4eda5 | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | VsyncCrypto/stakecube | bff96b4622b8fcfe1e767c252ceaf54c10d4eda5 | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | VsyncCrypto/stakecube | bff96b4622b8fcfe1e767c252ceaf54c10d4eda5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2013-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import biplist
from ds_store import DSStore
from mac_alias import Alias
import sys
output_file = sys.argv... | 61.866667 | 1,817 | 0.724407 |
373841d05368144873ea5e4e3477de4a98d10202 | 1,332 | py | Python | app/core/tests/test_admin.py | shreeshailaya/rest-api-recipeapp | 59e010c25fc7322d14f8028ed71ebdc3f5fc2329 | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | shreeshailaya/rest-api-recipeapp | 59e010c25fc7322d14f8028ed71ebdc3f5fc2329 | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | shreeshailaya/rest-api-recipeapp | 59e010c25fc7322d14f8028ed71ebdc3f5fc2329 | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSireTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email="admin@mech2it.com",
... | 31.714286 | 68 | 0.629129 |
0b59daacbf4051881d3272dcd6e1bd7d7ba32503 | 3,403 | py | Python | Demo/tkinter/guido/ShellWindow.py | AtjonTV/Python-1.4 | 2a80562c5a163490f444181cb75ca1b3089759ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | null | null | null | Demo/tkinter/guido/ShellWindow.py | AtjonTV/Python-1.4 | 2a80562c5a163490f444181cb75ca1b3089759ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | null | null | null | Demo/tkinter/guido/ShellWindow.py | AtjonTV/Python-1.4 | 2a80562c5a163490f444181cb75ca1b3089759ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | null | null | null | import os
import sys
import string
from Tkinter import *
from ScrolledText import ScrolledText
from Dialog import Dialog
import signal
BUFSIZE = 512
class ShellWindow(ScrolledText):
def __init__(self, master=None, shell=None, **cnf):
if not shell:
try:
shell = os.environ['SHELL']
except KeyError:
sh... | 22.686667 | 68 | 0.637967 |
33089e03375406a6c23f7aa1f559431c0065f4d1 | 4,727 | py | Python | vcspull/log.py | Segaja/vcspull | 6d4fe5e02870696e47923830548ad1c9f8edb4ab | [
"MIT"
] | null | null | null | vcspull/log.py | Segaja/vcspull | 6d4fe5e02870696e47923830548ad1c9f8edb4ab | [
"MIT"
] | 1 | 2022-03-22T02:08:49.000Z | 2022-03-22T02:08:49.000Z | vcspull/log.py | Segaja/vcspull | 6d4fe5e02870696e47923830548ad1c9f8edb4ab | [
"MIT"
] | null | null | null | """Log utilities for formatting CLI output.
vcspull.log
~~~~~~~~~~~
This module containers special formatters for processing the additional context
information from :class:`libvcs.base.RepoLoggingAdapter`.
Colorized formatters for generic logging inside the application is also
provided.
"""
import logging
import ti... | 23.873737 | 88 | 0.578168 |
c320d1bb36a3b6d152d967b00ed3ba4011d2627d | 3,987 | py | Python | gameplay/behaviours/cameraBehaviour.py | WilliamDASILVA/TheMysteryOfSchweitzer | f81edc2e202bd5009fc96ccfbbfcc40bc135a17a | [
"MIT"
] | null | null | null | gameplay/behaviours/cameraBehaviour.py | WilliamDASILVA/TheMysteryOfSchweitzer | f81edc2e202bd5009fc96ccfbbfcc40bc135a17a | [
"MIT"
] | null | null | null | gameplay/behaviours/cameraBehaviour.py | WilliamDASILVA/TheMysteryOfSchweitzer | f81edc2e202bd5009fc96ccfbbfcc40bc135a17a | [
"MIT"
] | null | null | null | from engine import Global;
from random import randint;
from engine import Update;
# --------------------------------------------------- *\
# Camera behaviour
# --------------------------------------------------- */
cameraToUse = None;
shakeIntensity = 0;
isCameraShaking = False;
isCameraFixed = False;
fixeTarget = Non... | 30.435115 | 128 | 0.543266 |
ecb484ab629a6a8bf2280d7aac82aac0bffdd2f8 | 15,222 | py | Python | lib/python/treadmill/syscall/inotify.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | 2 | 2017-10-31T18:48:20.000Z | 2018-03-04T20:35:20.000Z | lib/python/treadmill/syscall/inotify.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | null | null | null | lib/python/treadmill/syscall/inotify.py | bretttegart/treadmill | 812109e31c503a6eddaee2d3f2e1faf2833b6aaf | [
"Apache-2.0"
] | null | null | null | """Linux inotify(7) API wrapper module.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import collections
import logging
import operator
import os
import struct
import ctypes
from ctypes import (
c_int,
... | 28.188889 | 79 | 0.606228 |
787f1215bcb5d82f82b0c3eb2245c4b706cdb670 | 8,697 | py | Python | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/swagger_json_navigator.py | stickyparticles/lumberyard | dc523dd780f3cd1874251181b7cf6848b8db9959 | [
"AML"
] | 2 | 2019-11-29T09:04:54.000Z | 2021-03-18T02:34:44.000Z | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/swagger_json_navigator.py | JulianoCristian/Lumberyard-3 | dc523dd780f3cd1874251181b7cf6848b8db9959 | [
"AML"
] | null | null | null | dev/Gems/CloudGemFramework/v1/AWS/resource-manager-code/swagger_json_navigator.py | JulianoCristian/Lumberyard-3 | dc523dd780f3cd1874251181b7cf6848b8db9959 | [
"AML"
] | 3 | 2019-05-13T09:41:33.000Z | 2021-04-09T12:12:38.000Z | #
# All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or
# its licensors.
#
# For complete copyright and license terms please see the LICENSE at the root of this
# distribution (the "License"). All use of this software is governed by the License,
# or, if provided, by the license below or th... | 34.927711 | 128 | 0.61366 |
82c2a1c2c6d7ae30428299a80bdc638401533916 | 498 | py | Python | KeyLogger.py | Kyogin/PythonGERAL | 1e1be167c698050230fc07a3ddd2a2879fd26208 | [
"MIT"
] | null | null | null | KeyLogger.py | Kyogin/PythonGERAL | 1e1be167c698050230fc07a3ddd2a2879fd26208 | [
"MIT"
] | null | null | null | KeyLogger.py | Kyogin/PythonGERAL | 1e1be167c698050230fc07a3ddd2a2879fd26208 | [
"MIT"
] | null | null | null | #Code by: Matheus Franco // Kyogin
#Educational Content ONLY
#Feel free to change this code
from pynput.keyboard import Key, Listener
import logging
log_dir = "hook.txt" #.txt será criado no diretório no seu .py, caso queira alterar, colocar o caminho aí
logging.basicConfig(filename=(log_dir + "key_log.txt"... | 31.125 | 112 | 0.7249 |
4add4764e6f89b7b8ec08aa8ce427f8af47af362 | 134 | py | Python | Proyecto/DacodesJobs/Modulos/Candidatos/urls.py | angel318/DacodesJobs | 3a8bb0248ab8addf462b175e039ae935a5e34197 | [
"bzip2-1.0.6"
] | null | null | null | Proyecto/DacodesJobs/Modulos/Candidatos/urls.py | angel318/DacodesJobs | 3a8bb0248ab8addf462b175e039ae935a5e34197 | [
"bzip2-1.0.6"
] | null | null | null | Proyecto/DacodesJobs/Modulos/Candidatos/urls.py | angel318/DacodesJobs | 3a8bb0248ab8addf462b175e039ae935a5e34197 | [
"bzip2-1.0.6"
] | null | null | null | from django.urls import path
from .views import *
urlpatterns = [
path('<int:pk>', Candidatos.as_view(), name = 'Candidatos'),
]
| 19.142857 | 64 | 0.671642 |
f30780e17957580236e6460b273c028bb42b93c2 | 2,642 | py | Python | aidistillery/fasttext_embeddings.py | TheMTank/arxiv-summariser | db4f1e42bcc9185e197a00a18e280a4a3011453c | [
"MIT"
] | 17 | 2018-11-26T23:06:20.000Z | 2022-01-18T21:43:17.000Z | aidistillery/fasttext_embeddings.py | TheMTank/arxiv-summariser | db4f1e42bcc9185e197a00a18e280a4a3011453c | [
"MIT"
] | 3 | 2018-11-27T12:17:20.000Z | 2019-02-05T11:40:44.000Z | aidistillery/fasttext_embeddings.py | TheMTank/arxiv-summariser | db4f1e42bcc9185e197a00a18e280a4a3011453c | [
"MIT"
] | 3 | 2019-03-06T10:14:08.000Z | 2020-01-21T17:26:20.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Generate embeddings using word2vec from a text collection
Example: `distill fasttext -f data/text -o data/saved_embedding -d 100`
"""
import argparse
from .data_cleaning import list_of_strings_to_list_of_lists, clean_raw_text_from_file, phrasing_sentences
from .mod... | 37.211268 | 120 | 0.645344 |
b9ccf8c7b76cc287cd9ed06dbcfb491455f4cf1f | 755 | py | Python | ROIAlgebraOperation/ContourDelTest.py | az7jh2/My-Raystation-Scripts | 3454378239320c2944fd96de8cb86be8824b5210 | [
"MIT"
] | 1 | 2021-05-29T22:48:49.000Z | 2021-05-29T22:48:49.000Z | ROIAlgebraOperation/ContourDelTest.py | az7jh2/My-Raystation-Scripts | 3454378239320c2944fd96de8cb86be8824b5210 | [
"MIT"
] | null | null | null | ROIAlgebraOperation/ContourDelTest.py | az7jh2/My-Raystation-Scripts | 3454378239320c2944fd96de8cb86be8824b5210 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from connect import *
patient=get_current('Patient')
examination=get_current('Examination')
structure_set=patient.PatientModel.StructureSets[examination.Name]
roi_geometries=structure_set.RoiGeometries['Bodys']
if hasattr(roi_geometries.PrimaryShape,'Contours'):
#ROI的类型为Contours
contour=... | 31.458333 | 76 | 0.745695 |
ec939033c7afc401ed251ca6deed6ca722fa0638 | 761 | py | Python | src/compas_rv2/ui/Rhino/RV2/dev/RV2form_attributes_cmd.py | selinabitting/compas-RV2 | 0884cc00d09c8f4a75eb2b97614105e4c8bfd818 | [
"MIT"
] | 34 | 2020-04-27T13:54:38.000Z | 2022-01-17T19:16:27.000Z | src/compas_rv2/ui/Rhino/RV2/dev/RV2form_attributes_cmd.py | selinabitting/compas-RV2 | 0884cc00d09c8f4a75eb2b97614105e4c8bfd818 | [
"MIT"
] | 306 | 2020-04-27T12:00:54.000Z | 2022-03-23T22:28:54.000Z | src/compas_rv2/ui/Rhino/RV2/dev/RV2form_attributes_cmd.py | selinabitting/compas-RV2 | 0884cc00d09c8f4a75eb2b97614105e4c8bfd818 | [
"MIT"
] | 11 | 2020-06-30T08:23:40.000Z | 2022-02-01T20:47:39.000Z | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas_rv2.rhino import get_scene
from compas_rv2.rhino import AttributesForm
from compas_rv2.rhino import rv2_error
__commandname__ = "RV2form_attributes"
@rv2_error()
def RunCommand(is_interactive):
... | 21.138889 | 80 | 0.575558 |
d8cb0a8763608964a48dff37d11fcda4d170f96d | 5,957 | py | Python | bestmobabot/arena.py | moonzlo/bestmobabot | 8229de71a9d288daf6a7e513907821570e2eb111 | [
"MIT"
] | 2 | 2020-04-29T03:59:49.000Z | 2021-11-25T17:07:44.000Z | bestmobabot/arena.py | moonzlo/bestmobabot | 8229de71a9d288daf6a7e513907821570e2eb111 | [
"MIT"
] | null | null | null | bestmobabot/arena.py | moonzlo/bestmobabot | 8229de71a9d288daf6a7e513907821570e2eb111 | [
"MIT"
] | 1 | 2022-03-13T12:32:21.000Z | 2022-03-13T12:32:21.000Z | """
Arena hero selection logic.
"""
import math
from functools import reduce
from itertools import combinations, permutations
from operator import attrgetter, itemgetter
from typing import Callable, Iterable, List, Tuple, Optional, TypeVar
import numpy
from bestmobabot import types
from bestmobabot.logger import log... | 39.713333 | 134 | 0.616082 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.