hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | 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 245 | max_issues_repo_name stringlengths 6 130 | 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 245 | max_forks_repo_name stringlengths 6 130 | 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 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f726a1bf8f792d5b4f9b9594c9f703b8b87a1151 | 1,391 | py | Python | geniza/footnotes/migrations/0015_add_footnote_location_pp.py | kmcelwee/geniza | 0e59134e35357d4f80d85bf1e423edbc29d1edfb | [
"Apache-2.0"
] | null | null | null | geniza/footnotes/migrations/0015_add_footnote_location_pp.py | kmcelwee/geniza | 0e59134e35357d4f80d85bf1e423edbc29d1edfb | [
"Apache-2.0"
] | 5 | 2020-09-22T17:35:24.000Z | 2020-09-22T19:45:46.000Z | geniza/footnotes/migrations/0015_add_footnote_location_pp.py | kmcelwee/geniza | 0e59134e35357d4f80d85bf1e423edbc29d1edfb | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2.6 on 2021-12-15 21:28
from django.db import migrations
from django.db.models import F, Value
from django.db.models.functions import Concat
def add_pp_to_footnote_pages(apps, schema_editor):
# for footnotes that start with with a numeric location,
# we want to add pp. to make the mea... | 34.775 | 83 | 0.700216 |
from django.db import migrations
from django.db.models import F, Value
from django.db.models.functions import Concat
def add_pp_to_footnote_pages(apps, schema_editor):
Footnote = apps.get_model("footnotes", "Footnote")
Footnote.objects.filter(location__regex=r"^\d+$").update(... | true | true |
f726a26cfd9c320455025cb39ec2e30c2b3335a0 | 76,817 | py | Python | spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py | dan123456-eng/spyder | e57751e01d09a35b8f0583f9efd8dce318b17b4e | [
"MIT"
] | 1 | 2022-02-23T16:50:02.000Z | 2022-02-23T16:50:02.000Z | spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py | dan123456-eng/spyder | e57751e01d09a35b8f0583f9efd8dce318b17b4e | [
"MIT"
] | null | null | null | spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py | dan123456-eng/spyder | e57751e01d09a35b8f0583f9efd8dce318b17b4e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright © Spyder Project Contributors
#
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
# -----------------------------------------------------------------------------
"""
Te... | 34.743103 | 88 | 0.676777 |
import codecs
import glob
import os
import os.path as osp
import psutil
import shutil
import sys
import tempfile
from textwrap import dedent
import threading
import traceback
from unittest.mock import Mock
import IPython
from IPython.core import release as ipy_release
from IPython.core.application import ge... | true | true |
f726a2f4cad617630bb938793f65f75b2ac968fa | 5,832 | py | Python | src/ruvsarpur/ruv_client.py | HaukurPall/ruvsarpur | bf9befe37aa8c38e7b056372e11bb0f6450497a2 | [
"MIT"
] | null | null | null | src/ruvsarpur/ruv_client.py | HaukurPall/ruvsarpur | bf9befe37aa8c38e7b056372e11bb0f6450497a2 | [
"MIT"
] | null | null | null | src/ruvsarpur/ruv_client.py | HaukurPall/ruvsarpur | bf9befe37aa8c38e7b056372e11bb0f6450497a2 | [
"MIT"
] | null | null | null | import asyncio
import json
import logging
from pathlib import Path
from typing import Dict, List, TypedDict
from gql import Client, gql
from gql.client import AsyncClientSession
from gql.transport.aiohttp import AIOHTTPTransport
log = logging.getLogger(__name__)
class Episode(TypedDict):
id: str
title: str
... | 33.325714 | 122 | 0.558471 | import asyncio
import json
import logging
from pathlib import Path
from typing import Dict, List, TypedDict
from gql import Client, gql
from gql.client import AsyncClientSession
from gql.transport.aiohttp import AIOHTTPTransport
log = logging.getLogger(__name__)
class Episode(TypedDict):
id: str
title: str
... | true | true |
f726a329312efb2fda886586854705d5e3adad9f | 6,532 | py | Python | listWrangler_20191216.py | LukeHebert/genelist_overlap | 5275e9b1d8d5dae2a78b76aed42925bdd4914418 | [
"MIT"
] | null | null | null | listWrangler_20191216.py | LukeHebert/genelist_overlap | 5275e9b1d8d5dae2a78b76aed42925bdd4914418 | [
"MIT"
] | null | null | null | listWrangler_20191216.py | LukeHebert/genelist_overlap | 5275e9b1d8d5dae2a78b76aed42925bdd4914418 | [
"MIT"
] | null | null | null | '''
Author: Luke Hebert
Date begun: December 16th, 2019
Description: finds either the intersection, union, or unique items from a set of n lists
especially useful for comparing lists of genes
inputs for unique option need to be .txt files; this could be easily tweaked though
all input and output are forced to upper ... | 48.746269 | 150 | 0.729026 |
import os, sys
def getContents(paths_list):
contents_dict = {}
for file in paths_list:
contents_dict[file] = []
with open(file, 'r') as inFile:
for line in inFile:
line = line.strip('\n').strip('\r')
contents_dict[file].append(line.upper())
return contents_dict
slash = '\\' if os.name == 'nt' else ... | true | true |
f726a386b1ac9288db05e33cf07f7a65824e7d28 | 1,805 | py | Python | dataset_utils/check_bg_layer.py | ArthurWish/mmdetection | bd4c5b04e9d880f7a38131f17d3b43e4a3630c4f | [
"Apache-2.0"
] | null | null | null | dataset_utils/check_bg_layer.py | ArthurWish/mmdetection | bd4c5b04e9d880f7a38131f17d3b43e4a3630c4f | [
"Apache-2.0"
] | null | null | null | dataset_utils/check_bg_layer.py | ArthurWish/mmdetection | bd4c5b04e9d880f7a38131f17d3b43e4a3630c4f | [
"Apache-2.0"
] | null | null | null | import os
from PIL import Image, ImageDraw
from tqdm import tqdm
def label_bg_layer(img_path, label_path, img_type):
bg_data_list = os.listdir(img_path)
label_list = os.listdir(label_path)
label_prefix_list = []
for label in label_list:
label = os.path.splitext(label)[0]
label_prefix_li... | 41.022727 | 117 | 0.532964 | import os
from PIL import Image, ImageDraw
from tqdm import tqdm
def label_bg_layer(img_path, label_path, img_type):
bg_data_list = os.listdir(img_path)
label_list = os.listdir(label_path)
label_prefix_list = []
for label in label_list:
label = os.path.splitext(label)[0]
label_prefix_li... | true | true |
f726a3f0bc85a62b7c621cc217d1f66bc6ba1017 | 4,272 | py | Python | etl/deaths.py | icane/demographic-indicators | b1c394a4497e8e4c0189bf4c0518ce38fb873d4c | [
"Apache-2.0"
] | null | null | null | etl/deaths.py | icane/demographic-indicators | b1c394a4497e8e4c0189bf4c0518ce38fb873d4c | [
"Apache-2.0"
] | 1 | 2022-01-18T11:01:29.000Z | 2022-01-18T11:01:29.000Z | etl/deaths.py | icane/demographic-indicators | b1c394a4497e8e4c0189bf4c0518ce38fb873d4c | [
"Apache-2.0"
] | null | null | null | """Deaths indicators."""
from etl.common import to_json_stat, write_to_file
from etl.config_deaths import deaths_cfg as cfg
from etlstat.extractor.extractor import xlsx
import json
import pandas as pd
def transform(df, periods, prefix=''):
"""Slice dataframe. Generate time period column.
df (dat... | 33.637795 | 75 | 0.612125 |
from etl.common import to_json_stat, write_to_file
from etl.config_deaths import deaths_cfg as cfg
from etlstat.extractor.extractor import xlsx
import json
import pandas as pd
def transform(df, periods, prefix=''):
for i in range(0, len(df)):
period1 = str(df.loc[i, 'Año'])
period2 = '{:0>2}'... | true | true |
f726a514c5af450b08e924325a355027db5b2bb3 | 2,355 | py | Python | tests/test_payment_chargebacks.py | elcolumbio/mollie-api-python | 743c7c10df5916bfa14e2c4e82ad5cca17bc2ae3 | [
"BSD-2-Clause"
] | null | null | null | tests/test_payment_chargebacks.py | elcolumbio/mollie-api-python | 743c7c10df5916bfa14e2c4e82ad5cca17bc2ae3 | [
"BSD-2-Clause"
] | 3 | 2018-09-21T12:02:44.000Z | 2018-09-26T12:01:00.000Z | tests/test_payment_chargebacks.py | elcolumbio/mollie-api-python | 743c7c10df5916bfa14e2c4e82ad5cca17bc2ae3 | [
"BSD-2-Clause"
] | null | null | null | from mollie.api.objects.chargeback import Chargeback
from .utils import assert_list_object
PAYMENT_ID = 'tr_7UhSN1zuXS'
CHARGEBACK_ID = 'chb_n9z0tp'
def test_get_payment_chargebacks_by_payment_id(client, response):
"""Get chargebacks relevant to payment by payment id."""
response.get('https://api.mollie.com... | 45.288462 | 102 | 0.745648 | from mollie.api.objects.chargeback import Chargeback
from .utils import assert_list_object
PAYMENT_ID = 'tr_7UhSN1zuXS'
CHARGEBACK_ID = 'chb_n9z0tp'
def test_get_payment_chargebacks_by_payment_id(client, response):
response.get('https://api.mollie.com/v2/payments/%s/chargebacks' % PAYMENT_ID, 'chargebacks_list'... | true | true |
f726a8242f8fd6b97a2dbc1d66d1b2ffa30955db | 4,308 | py | Python | probability_combinatorics/linear_regression.py | codecakes/random_games | 1e670021ec97a196726e937e658878dc63ba9d34 | [
"MIT"
] | null | null | null | probability_combinatorics/linear_regression.py | codecakes/random_games | 1e670021ec97a196726e937e658878dc63ba9d34 | [
"MIT"
] | null | null | null | probability_combinatorics/linear_regression.py | codecakes/random_games | 1e670021ec97a196726e937e658878dc63ba9d34 | [
"MIT"
] | null | null | null | from math import sqrt
from itertools import izip
from numpy import mean
from py_variance_std import t_percentile
def calc_slope(r, sdy, sdx): return r * (float(sdy)/sdx)
def line_fitting(x_arr, y_arr):
"""
using straight line y = mx + c;
m(of a sample data points) = Covariance(X,Y)/Covariance(X,X) =
... | 35.311475 | 154 | 0.669452 | from math import sqrt
from itertools import izip
from numpy import mean
from py_variance_std import t_percentile
def calc_slope(r, sdy, sdx): return r * (float(sdy)/sdx)
def line_fitting(x_arr, y_arr):
xbar = mean(x_arr)
ybar = mean(y_arr)
xsqr_bar = mean([i**2 for i in x_arr])
xybar = mean([i*j for ... | true | true |
f726a835b02eb3b1ea4dadc3134351ab0143ad58 | 1,806 | py | Python | tools/photon_yield.py | LeoRoweBrown/ckvpy | fff27847f5577750ae5860e3fdff81877fa4455a | [
"MIT"
] | null | null | null | tools/photon_yield.py | LeoRoweBrown/ckvpy | fff27847f5577750ae5860e3fdff81877fa4455a | [
"MIT"
] | null | null | null | tools/photon_yield.py | LeoRoweBrown/ckvpy | fff27847f5577750ae5860e3fdff81877fa4455a | [
"MIT"
] | null | null | null | import numpy as np
from scipy.integrate import simps
import scipy.constants as const
def compute(theta_in, f, beta, L, n=None):
"""compute number of photons due to Frank-Tamm and Fresen equations
theta (ndarray/list[float]): Angles in chosen wavelength range
f (ndarray/list[float]): Frequencies in chosen w... | 42 | 73 | 0.633444 | import numpy as np
from scipy.integrate import simps
import scipy.constants as const
def compute(theta_in, f, beta, L, n=None):
if n is None:
print("Using Cherenkov angle to derive n instead of d(omega)/dk")
n = 1/(beta*np.cos(theta_in))
r_s = np.absolute(
(n*np.cos(theta_in) - np.sqrt(... | true | true |
f726a842f0367a5bce40537953cbd52aa33b1909 | 4,830 | py | Python | model/network.py | andrewschreiber/numpy-saliency | 2e788a1150f6e160f2271cbb4f20747559f243c0 | [
"MIT"
] | 10 | 2019-07-30T02:36:21.000Z | 2020-12-22T06:35:40.000Z | model/network.py | andrewschreiber/numpy-saliency | 2e788a1150f6e160f2271cbb4f20747559f243c0 | [
"MIT"
] | 6 | 2019-08-09T02:17:38.000Z | 2022-03-11T23:56:24.000Z | model/network.py | andrewschreiber/numpy-saliency | 2e788a1150f6e160f2271cbb4f20747559f243c0 | [
"MIT"
] | 2 | 2019-08-03T08:38:26.000Z | 2020-06-29T12:58:47.000Z | import numpy as np
import pickle
from model.loss import cross_entropy
from model.layers import Conv2D, Maxpool2D, Dense, Flatten, ReLu, Softmax
class LeNet5:
"""Implementation of LeNet 5 for MNIST
http://yann.lecun.com/exdb/publis/pdf/lecun-98.pdf
"""
def __init__(self, weights_path=None):
... | 38.951613 | 79 | 0.522774 | import numpy as np
import pickle
from model.loss import cross_entropy
from model.layers import Conv2D, Maxpool2D, Dense, Flatten, ReLu, Softmax
class LeNet5:
def __init__(self, weights_path=None):
lr = 0.01
layers = []
layers.append(Conv2D(n_filter=6, n_channel=1,
... | true | true |
f726aa04174ce7bf2f5c510516bdd17021d883d8 | 6,175 | py | Python | deepecg/training/model/disc/model.py | Seb-Good/deepecg | c99fbe80718ee9969936154ae2c1a04d81c9b246 | [
"MIT"
] | 56 | 2019-02-20T04:47:25.000Z | 2022-03-23T01:12:43.000Z | deepecg/training/model/disc/model.py | vivektalwar13071999/deepecg | c99fbe80718ee9969936154ae2c1a04d81c9b246 | [
"MIT"
] | 7 | 2019-12-16T20:59:36.000Z | 2022-02-09T23:48:59.000Z | deepecg/training/model/disc/model.py | vivektalwar13071999/deepecg | c99fbe80718ee9969936154ae2c1a04d81c9b246 | [
"MIT"
] | 22 | 2019-02-24T02:57:20.000Z | 2022-03-23T01:12:49.000Z | """
model.py
--------
This module provides a class and methods for building and managing a model with tensorflow.
By: Sebastian D. Goodfellow, Ph.D., 2018
"""
# Compatibility imports
from __future__ import absolute_import, division, print_function
# 3rd party imports
import os
import sys
import json
import pickle
imp... | 35.488506 | 117 | 0.674494 |
from __future__ import absolute_import, division, print_function
import os
import sys
import json
import pickle
import tensorflow as tf
from deepecg.training.model.disc.graph import Graph
from deepecg.training.networks.deep_ecg_v1 import DeepECGV1
from deepecg.training.networks.deep_ecg_v2 import DeepECGV2
from d... | true | true |
f726aa89dee842342ea1bd383144960b734ac342 | 607 | py | Python | setup.py | Yoshiki443/weather_parameters | ae2c9ed02f68968cb6ea0610d556f3c68bbc923e | [
"MIT"
] | 17 | 2020-04-26T20:25:56.000Z | 2022-03-10T09:41:54.000Z | setup.py | Yoshiki443/weather_parameters | ae2c9ed02f68968cb6ea0610d556f3c68bbc923e | [
"MIT"
] | null | null | null | setup.py | Yoshiki443/weather_parameters | ae2c9ed02f68968cb6ea0610d556f3c68bbc923e | [
"MIT"
] | 1 | 2020-06-08T04:54:30.000Z | 2020-06-08T04:54:30.000Z | import setuptools
setuptools.setup(
name="wxparams",
version="1.5",
author="Yoshiki Kato",
# author_email="",
description="Weather Parameters Calculator",
long_description="This is a python module for calculating meteorological parameters.",
long_description_content_type="text/markdown",
... | 30.35 | 90 | 0.678748 | import setuptools
setuptools.setup(
name="wxparams",
version="1.5",
author="Yoshiki Kato",
description="Weather Parameters Calculator",
long_description="This is a python module for calculating meteorological parameters.",
long_description_content_type="text/markdown",
url="https://git... | true | true |
f726aacd3954efc8b82de1b378ebd375941886de | 6,348 | py | Python | Testing/ND-Testing.py | garibaldu/boundary-seekers | 441fea01e93de882bf22e0deb411f0b10602fa37 | [
"MIT"
] | null | null | null | Testing/ND-Testing.py | garibaldu/boundary-seekers | 441fea01e93de882bf22e0deb411f0b10602fa37 | [
"MIT"
] | null | null | null | Testing/ND-Testing.py | garibaldu/boundary-seekers | 441fea01e93de882bf22e0deb411f0b10602fa37 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
def __perms(n):
if not n:
return
p = []
for i in range(0, 2**n):
s = bin(i)[2:]
s = "0" * (n-len(s)) + s
s_prime = np.array(list(map(lambda x: int(x), list(s))))
p.append(s_prime)
return p
def care(normal, bias, exa... | 29.943396 | 150 | 0.594045 | import numpy as np
import tensorflow as tf
def __perms(n):
if not n:
return
p = []
for i in range(0, 2**n):
s = bin(i)[2:]
s = "0" * (n-len(s)) + s
s_prime = np.array(list(map(lambda x: int(x), list(s))))
p.append(s_prime)
return p
def care(normal, bias, exa... | true | true |
f726aafdc70d344f7835f59ea676ff8263ce502c | 6,600 | py | Python | Lib/site-packages/wx-2.8-msw-unicode/wx/tools/XRCed/plugins/xh_gizmos.py | ekkipermana/robotframework-test | 243ca26f69962f8cf20cd7d054e0ff3e709bc7f4 | [
"bzip2-1.0.6"
] | 27 | 2020-11-12T19:24:54.000Z | 2022-03-27T23:10:45.000Z | Lib/site-packages/wx-2.8-msw-unicode/wx/tools/XRCed/plugins/xh_gizmos.py | ekkipermana/robotframework-test | 243ca26f69962f8cf20cd7d054e0ff3e709bc7f4 | [
"bzip2-1.0.6"
] | 2 | 2020-11-02T06:30:39.000Z | 2022-02-23T18:39:55.000Z | Lib/site-packages/wx-2.8-msw-unicode/wx/tools/XRCed/plugins/xh_gizmos.py | ekkipermana/robotframework-test | 243ca26f69962f8cf20cd7d054e0ff3e709bc7f4 | [
"bzip2-1.0.6"
] | 7 | 2018-02-13T10:22:39.000Z | 2019-07-04T07:39:28.000Z | # Name: gizmos.py
# Purpose: XML handlers for wx.gismos classes
# Author: Roman Rolinsky <rolinsky@femagsoft.com>
# Created: 09.07.2007
# RCS-ID: $Id$
import wx
import wx.xrc as xrc
import wx.gizmos as gizmos
class LEDNumberCtrlXmlHandler(xrc.XmlResourceHandler):
def __init__(self):
... | 39.285714 | 86 | 0.601667 |
import wx
import wx.xrc as xrc
import wx.gizmos as gizmos
class LEDNumberCtrlXmlHandler(xrc.XmlResourceHandler):
def __init__(self):
xrc.XmlResourceHandler.__init__(self)
self.AddWindowStyles()
self.AddStyle('wxLED_ALIGN_LEFT', gizmos.LED_ALIGN_LEFT)
self.Add... | true | true |
f726ab4ccfc111179e65303e6251acccc8a648d5 | 4,241 | py | Python | loot_tables.py | Battlecats59/MCBELootRandomizer | de5c49c65fb12c1e3ec391b665bdfd9a5c64c7cc | [
"MIT"
] | null | null | null | loot_tables.py | Battlecats59/MCBELootRandomizer | de5c49c65fb12c1e3ec391b665bdfd9a5c64c7cc | [
"MIT"
] | null | null | null | loot_tables.py | Battlecats59/MCBELootRandomizer | de5c49c65fb12c1e3ec391b665bdfd9a5c64c7cc | [
"MIT"
] | null | null | null | import os
import json
import yaml
from typing import OrderedDict
from yaml.loader import FullLoader
from paths import RANDO_ROOT_PATH
class loot_tables:
def get_loot_tables(self, options):
with (RANDO_ROOT_PATH / 'loot_table_categories.yaml').open('r') as loot_tables:
self.loot_table_list = y... | 47.651685 | 169 | 0.680736 | import os
import json
import yaml
from typing import OrderedDict
from yaml.loader import FullLoader
from paths import RANDO_ROOT_PATH
class loot_tables:
def get_loot_tables(self, options):
with (RANDO_ROOT_PATH / 'loot_table_categories.yaml').open('r') as loot_tables:
self.loot_table_list = y... | true | true |
f726ace460929f064637dcdfe1b9260b82a5a76e | 1,618 | py | Python | examples/ad_manager/v201802/publisher_query_language_service/get_line_items_named_like.py | khanhnhk/googleads-python-lib | 1e882141b8eb663b55dd582ce0f4fbf3cd2f672d | [
"Apache-2.0"
] | 1 | 2021-12-30T15:21:42.000Z | 2021-12-30T15:21:42.000Z | examples/ad_manager/v201802/publisher_query_language_service/get_line_items_named_like.py | benlistyg/googleads-python-lib | 1e882141b8eb663b55dd582ce0f4fbf3cd2f672d | [
"Apache-2.0"
] | null | null | null | examples/ad_manager/v201802/publisher_query_language_service/get_line_items_named_like.py | benlistyg/googleads-python-lib | 1e882141b8eb663b55dd582ce0f4fbf3cd2f672d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 33.020408 | 76 | 0.725587 |
"""This example fetches line items from the pql table with a LIKE clause."""
import tempfile
from googleads import ad_manager
def main(client):
report_downloader = client.GetDataDownloader(version='v201802')
with tempfile.NamedTemporaryFile(
prefix='line_items_',
suffix='.csv',... | false | true |
f726ad04313fae09750869fe143024d0fb1c7b02 | 1,794 | py | Python | release/stubs.min/System/Drawing/__init___parts/CopyPixelOperation.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Drawing/__init___parts/CopyPixelOperation.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Drawing/__init___parts/CopyPixelOperation.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | class CopyPixelOperation(Enum,IComparable,IFormattable,IConvertible):
"""
Determines how the source color in a copy pixel operation is combined with the destination color to result in a final color.
enum CopyPixelOperation,values: Blackness (66),CaptureBlt (1073741824),DestinationInvert (5570569),MergeCopy (... | 33.849057 | 411 | 0.726867 | class CopyPixelOperation(Enum,IComparable,IFormattable,IConvertible):
return CopyPixelOperation()
def __eq__(self,*args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
""" __format__(formattable: IFormattable,format: str) -> str """
pass
pass
def __gt__(self,*args):
... | true | true |
f726ad8c7093593009fdde16473a6c6d5e036bd8 | 11,476 | py | Python | python/GUI/__main__.py | andreehultgren/soduko | aae2d174e417d00ed60206f4567e554d25aa4311 | [
"MIT"
] | null | null | null | python/GUI/__main__.py | andreehultgren/soduko | aae2d174e417d00ed60206f4567e554d25aa4311 | [
"MIT"
] | null | null | null | python/GUI/__main__.py | andreehultgren/soduko | aae2d174e417d00ed60206f4567e554d25aa4311 | [
"MIT"
] | null | null | null | import pygame
from random import sample, randint, random
from tabulate import tabulate
config = {
"cell_width" : 50,
"cell_height" : 50,
"cell_color" : (235,235,235),
"cell_color_hover" : (220,220,255),
... | 36.08805 | 174 | 0.548013 | import pygame
from random import sample, randint, random
from tabulate import tabulate
config = {
"cell_width" : 50,
"cell_height" : 50,
"cell_color" : (235,235,235),
"cell_color_hover" : (220,220,255),
... | true | true |
f726af04dc7785db1b54ef4a6b8f7b5c33ebd894 | 878 | py | Python | server/fadzmaq.py | lachierussell/FadZmaq | deb89c35df05603552ce95627ac8400c6788fbcb | [
"BSD-2-Clause"
] | 2 | 2019-09-02T06:56:46.000Z | 2019-09-15T08:43:54.000Z | server/fadzmaq.py | lachierussell/FadZmaq | deb89c35df05603552ce95627ac8400c6788fbcb | [
"BSD-2-Clause"
] | 11 | 2019-08-27T19:08:24.000Z | 2019-10-18T01:45:54.000Z | server/fadzmaq.py | lachierussell/FadZmaq | deb89c35df05603552ce95627ac8400c6788fbcb | [
"BSD-2-Clause"
] | 1 | 2019-10-25T05:42:48.000Z | 2019-10-25T05:42:48.000Z | # @file
# The application entry point. Run this file to use the FadZmaq Server.
#
# FadZmaq Project
# Professional Computing. Semester 2 2019
#
# Copyright FadZmaq © 2019 All rights reserved.
# @author Lachlan Russell 22414249@student.uwa.edu.au
# @author Jordan Russell jordanrussell@live.com
# @autho... | 30.275862 | 71 | 0.750569 |
from fadzmaq import create_app
import fadzmaq
import firebase_admin
from sqlalchemy import create_engine
app = create_app()
cred = firebase_admin.credentials.Certificate(app.config['CERT'])
fadzmaq.auth_app = firebase_admin.initialize_app(cred)
fadzmaq.engine = create_engine(app.config['DATABASE_URI'])
... | true | true |
f726b000f7751f551512bc88f402ed4f784b69c2 | 6,428 | py | Python | dev/breeze/src/airflow_breeze/build_image/ci/build_ci_params.py | npodewitz/airflow | 511ea702d5f732582d018dad79754b54d5e53f9d | [
"Apache-2.0"
] | null | null | null | dev/breeze/src/airflow_breeze/build_image/ci/build_ci_params.py | npodewitz/airflow | 511ea702d5f732582d018dad79754b54d5e53f9d | [
"Apache-2.0"
] | null | null | null | dev/breeze/src/airflow_breeze/build_image/ci/build_ci_params.py | npodewitz/airflow | 511ea702d5f732582d018dad79754b54d5e53f9d | [
"Apache-2.0"
] | null | null | null | # 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... | 35.125683 | 104 | 0.706752 |
import os
from dataclasses import dataclass
from datetime import datetime
from pathlib import Path
from typing import List, Optional
from airflow_breeze.branch_defaults import AIRFLOW_BRANCH, DEFAULT_AIRFLOW_CONSTRAINTS_BRANCH
from airflow_breeze.global_constants import get_airflow_version
from airflow... | true | true |
f726b031d40348c933768960ba80fab387456438 | 356 | py | Python | src/grasshopper_combat.py | hcodydibble/code-katas | f02599a76ac5c3719b1e3831208126eb4b72e98d | [
"MIT"
] | null | null | null | src/grasshopper_combat.py | hcodydibble/code-katas | f02599a76ac5c3719b1e3831208126eb4b72e98d | [
"MIT"
] | null | null | null | src/grasshopper_combat.py | hcodydibble/code-katas | f02599a76ac5c3719b1e3831208126eb4b72e98d | [
"MIT"
] | null | null | null | """Grasshopper - Terminal game combat function - Return remaining health after
taking damage.
# 1 Best Practices solution by ZozoFouchtra and others
def combat(health, damage):
return max(0, health-damage)
"""
def combat(health, damage):
"""Find remaining health after taking damage."""
return 0 if healt... | 25.428571 | 78 | 0.724719 |
def combat(health, damage):
return 0 if health - damage < 0 else health - damage
| true | true |
f726b1139d55db10b37ce1d0847019a581954a25 | 4,460 | py | Python | sdks/python/apache_beam/io/gcp/bigquery_avro_tools.py | eyal0/beam | 9c6922976cc2a5c6a2ef836c1986ff769cda99a5 | [
"Apache-2.0"
] | 2 | 2017-12-19T18:34:54.000Z | 2019-05-14T21:50:06.000Z | sdks/python/apache_beam/io/gcp/bigquery_avro_tools.py | eyal0/beam | 9c6922976cc2a5c6a2ef836c1986ff769cda99a5 | [
"Apache-2.0"
] | 80 | 2020-01-16T09:55:09.000Z | 2020-10-03T13:43:07.000Z | sdks/python/apache_beam/io/gcp/bigquery_avro_tools.py | eyal0/beam | 9c6922976cc2a5c6a2ef836c1986ff769cda99a5 | [
"Apache-2.0"
] | 1 | 2020-04-29T20:09:40.000Z | 2020-04-29T20:09:40.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 us... | 31.631206 | 180 | 0.679596 |
from __future__ import absolute_import
from __future__ import division
{
"STRUCT": "record",
"RECORD": "record",
"STRING": "string",
"BOOL": "boolean",
"BOOLEAN": "boolean",
"BYTES": "bytes",
"FLOAT64": "double",
"FLOAT": "double",
"INT64": "long",
"INTEGER... | true | true |
f726b1967d8348b9c13635036359c128ffc392c3 | 750 | py | Python | src/language/Perl.py | fearless-spider/repo_info_extractor | fd9301d9ea637df19dcc015e70c300e2eea54a45 | [
"MIT"
] | 2 | 2019-11-27T15:21:42.000Z | 2020-12-12T15:17:42.000Z | src/language/Perl.py | fearless-spider/repo_info_extractor | fd9301d9ea637df19dcc015e70c300e2eea54a45 | [
"MIT"
] | null | null | null | src/language/Perl.py | fearless-spider/repo_info_extractor | fd9301d9ea637df19dcc015e70c300e2eea54a45 | [
"MIT"
] | null | null | null | import re
def extract_libraries(files):
"""Extracts a list of imports that were used in the files
Parameters
----------
files : []string
Full paths to files that need to be analysed
Returns
-------
dict
imports that were used in the provided files, mapped against the langu... | 24.193548 | 120 | 0.536 | import re
def extract_libraries(files):
res = []
regex = re.compile(r"(?:[^#]\s+)(?:use|require)[^\S\n]+(?:if.*,\s+)?[\"']?([a-zA-Z][a-zA-Z0-9:]*)[\"']?(?:\s+.*)?;")
for f in files:
with open(file=f, mode='r', errors='ignore') as fr:
contents = ' '.join(fr.readlines())
... | true | true |
f726b22a3876f904a6f1d950541f05c40c664edb | 4,607 | py | Python | python_gyg/tests/test_location.py | fukac99/python_gyg | 2722da1b2a858336fff584af5acc3e78135ab8a1 | [
"MIT"
] | 1 | 2019-05-22T19:37:16.000Z | 2019-05-22T19:37:16.000Z | python_gyg/tests/test_location.py | fukac99/python_gyg | 2722da1b2a858336fff584af5acc3e78135ab8a1 | [
"MIT"
] | null | null | null | python_gyg/tests/test_location.py | fukac99/python_gyg | 2722da1b2a858336fff584af5acc3e78135ab8a1 | [
"MIT"
] | null | null | null | from unittest import TestCase
import python_gyg
import datetime
GYG_API_KEY = "<your_api_key>"
class TestLocation(TestCase):
def test_is_GetYourGuide_isntance(self):
s = python_gyg.GetYourGuide(GYG_API_KEY)
self.assertTrue(isinstance(s, python_gyg.GetYourGuide))
# def test_get_locatio... | 45.166667 | 119 | 0.682223 | from unittest import TestCase
import python_gyg
import datetime
GYG_API_KEY = "<your_api_key>"
class TestLocation(TestCase):
def test_is_GetYourGuide_isntance(self):
s = python_gyg.GetYourGuide(GYG_API_KEY)
self.assertTrue(isinstance(s, python_gyg.GetYourGuide))
def test_... | true | true |
f726b366c9cf2b7cd4cfde6038b4f205fcd52e43 | 1,036 | py | Python | vyperlogix/zlib/zlibCompressor.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | 1 | 2020-09-29T01:36:33.000Z | 2020-09-29T01:36:33.000Z | vyperlogix/zlib/zlibCompressor.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | null | null | null | vyperlogix/zlib/zlibCompressor.py | raychorn/chrome_gui | f1fade70b61af12ee43c55c075aa9cfd32caa962 | [
"CC0-1.0"
] | null | null | null | import gzip, zlib, base64
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
__copyright__ = """\
(c). Copyright 2008-2020, Vyper Logix Corp., All Rights Reserved.
Published under Creative Commons License
(http://creativecommons.org/licenses/by-nc/3.0/)
restricted to non-... | 31.393939 | 70 | 0.779923 | import gzip, zlib, base64
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
__copyright__ = """\
(c). Copyright 2008-2020, Vyper Logix Corp., All Rights Reserved.
Published under Creative Commons License
(http://creativecommons.org/licenses/by-nc/3.0/)
restricted to non-... | true | true |
f726b54f3a46ebdee086c417557534ca46be6aee | 1,875 | py | Python | examples/pacman/independent.py | okkhoy/rlpy | af25d2011fff1d61cb7c5cc8992549808f0c6103 | [
"BSD-3-Clause"
] | 265 | 2015-01-21T08:11:12.000Z | 2021-12-21T08:06:21.000Z | examples/pacman/independent.py | okkhoy/rlpy | af25d2011fff1d61cb7c5cc8992549808f0c6103 | [
"BSD-3-Clause"
] | 22 | 2015-03-26T17:41:43.000Z | 2019-12-19T08:47:36.000Z | examples/pacman/independent.py | okkhoy/rlpy | af25d2011fff1d61cb7c5cc8992549808f0c6103 | [
"BSD-3-Clause"
] | 85 | 2015-02-18T00:25:15.000Z | 2021-11-15T11:10:00.000Z | """
Cart-pole balancing with independent discretization
"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from rlpy.Domains import Pacman
from rlp... | 32.894737 | 98 | 0.700267 | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from rlpy.Domains import Pacman
from rlpy.Agents import Q_Learning
from rlpy.Representations import ... | true | true |
f726b5f40791ce2171ac294bd9cf1073746baf44 | 2,896 | py | Python | saleor/checkout/views/discount.py | dedhio/bellastore | 03cad4d11c039c6c33291021def812570c09fe36 | [
"BSD-3-Clause"
] | 3 | 2019-06-09T18:00:54.000Z | 2019-06-18T10:07:39.000Z | saleor/checkout/views/discount.py | dedhio/bellastore | 03cad4d11c039c6c33291021def812570c09fe36 | [
"BSD-3-Clause"
] | 2 | 2019-07-03T21:08:32.000Z | 2019-08-06T02:09:26.000Z | saleor/checkout/views/discount.py | dedhio/bellastore | 03cad4d11c039c6c33291021def812570c09fe36 | [
"BSD-3-Clause"
] | 1 | 2021-04-03T10:47:36.000Z | 2021-04-03T10:47:36.000Z | from datetime import date
from functools import wraps
from django.contrib import messages
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from django.utils.translation import pgettext
from django.views.decorators.http import require_POST
from ...discount.models import Vouch... | 34.070588 | 80 | 0.658494 | from datetime import date
from functools import wraps
from django.contrib import messages
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from django.utils.translation import pgettext
from django.views.decorators.http import require_POST
from ...discount.models import Vouch... | true | true |
f726b60b2e30efcf835322d9c0d038acf405f3ab | 895 | py | Python | 086.py | zlsun/ProjectEuler | 813ec545484924a052f1bd7fd90a4c676eea3bba | [
"MIT"
] | null | null | null | 086.py | zlsun/ProjectEuler | 813ec545484924a052f1bd7fd90a4c676eea3bba | [
"MIT"
] | null | null | null | 086.py | zlsun/ProjectEuler | 813ec545484924a052f1bd7fd90a4c676eea3bba | [
"MIT"
] | null | null | null | #-*- encoding: utf-8 -*-
"""
Cuboid route
A spider, S, sits in one corner of a cuboid room, measuring 6 by 5 by 3, and a fly, F, sits in the opposite corner. By travelling on the surfaces of the room the shortest "straight line" distance from S to F is 10 and the path is shown on the diagram.
However, there are up ... | 49.722222 | 341 | 0.75419 |
from utils import *
| true | true |
f726b71c0d372ca68b0e214f1e0ae937fead58bb | 642 | py | Python | url_migration/management/commands/remove_expired_redirects.py | riklaunim/django-url-migration | 0d1115d02b64a895934ecdd7387e65b34b3d68e7 | [
"BSD-3-Clause"
] | 4 | 2017-04-28T18:58:31.000Z | 2017-10-04T07:32:47.000Z | url_migration/management/commands/remove_expired_redirects.py | riklaunim/django-url-migration | 0d1115d02b64a895934ecdd7387e65b34b3d68e7 | [
"BSD-3-Clause"
] | 3 | 2021-04-23T11:30:49.000Z | 2021-04-26T14:12:29.000Z | url_migration/management/commands/remove_expired_redirects.py | riklaunim/django-url-migration | 0d1115d02b64a895934ecdd7387e65b34b3d68e7 | [
"BSD-3-Clause"
] | 1 | 2021-04-23T11:07:36.000Z | 2021-04-23T11:07:36.000Z | from django.core.management.base import BaseCommand
from django.utils import timezone
from url_migration import models
class Command(BaseCommand):
def handle(self, **options):
for rule in models.UrlRegexpMapping.objects.filter(last_usage__isnull=False):
self._remove_if_unused(rule)
fo... | 35.666667 | 85 | 0.71028 | from django.core.management.base import BaseCommand
from django.utils import timezone
from url_migration import models
class Command(BaseCommand):
def handle(self, **options):
for rule in models.UrlRegexpMapping.objects.filter(last_usage__isnull=False):
self._remove_if_unused(rule)
fo... | true | true |
f726b73d345c483e69c29ca4afc5bfc2e99d7b7f | 4,201 | py | Python | fellowship/contract_generator.py | nokia/contract-test-framework | 67976b3361b1bb28639059720d247987ff203224 | [
"BSD-3-Clause"
] | 2 | 2021-10-05T06:47:07.000Z | 2022-03-03T23:34:50.000Z | fellowship/contract_generator.py | nokia/contract-test-framework | 67976b3361b1bb28639059720d247987ff203224 | [
"BSD-3-Clause"
] | 10 | 2021-09-02T06:58:55.000Z | 2021-12-03T19:21:39.000Z | fellowship/contract_generator.py | nokia/contract-test-framework | 67976b3361b1bb28639059720d247987ff203224 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2021 Nokia
# Licensed under the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
import json
import logging
import os
from urllib.parse import urlparse
from genson import SchemaBuilder
from .contract_renderer import ContractRenderer
from .strict_schema_builder import StrictSchema... | 42.434343 | 89 | 0.660081 |
import json
import logging
import os
from urllib.parse import urlparse
from genson import SchemaBuilder
from .contract_renderer import ContractRenderer
from .strict_schema_builder import StrictSchemaBuilder
LOGGER = logging.getLogger(__name__)
class ContractGenerator:
def __init__(self, ... | true | true |
f726b7dadf4efb4ce13b43f57fed824b080e01f6 | 387 | py | Python | nifty/wsgi.py | waynekyamamoto/jakobia | 04b82f620267f500d7b19937ef2631c6a840c42a | [
"Apache-2.0"
] | null | null | null | nifty/wsgi.py | waynekyamamoto/jakobia | 04b82f620267f500d7b19937ef2631c6a840c42a | [
"Apache-2.0"
] | null | null | null | nifty/wsgi.py | waynekyamamoto/jakobia | 04b82f620267f500d7b19937ef2631c6a840c42a | [
"Apache-2.0"
] | null | null | null | """
WSGI config for nifty project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTING... | 22.764706 | 78 | 0.782946 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'nifty.settings')
application = get_wsgi_application()
| true | true |
f726b86af605e3f6febf6ed5b3e113bf41b88604 | 1,158 | py | Python | tests/metrics/test_statsd_metrics.py | bear8421/thumbor | 00a0c44d44b8fa5f06c38deee7123793addda404 | [
"MIT"
] | 1 | 2021-12-24T02:01:52.000Z | 2021-12-24T02:01:52.000Z | tests/metrics/test_statsd_metrics.py | bear8421/thumbor | 00a0c44d44b8fa5f06c38deee7123793addda404 | [
"MIT"
] | 2 | 2022-03-10T22:11:18.000Z | 2022-03-16T22:42:04.000Z | tests/metrics/test_statsd_metrics.py | bear8421/thumbor | 00a0c44d44b8fa5f06c38deee7123793addda404 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
from preggy import expect
import thumbor.metrics
from tests.base im... | 29.692308 | 79 | 0.707254 |
from preggy import expect
import thumbor.metrics
from tests.base import TestCase
from thumbor.config import Config
from thumbor.context import Context
from thumbor.importer import Importer
class StatsdMetricsTestCase(TestCase):
def get_context(self):
conf = Config()
conf.METRICS = "thum... | true | true |
f726b86fa3b46ca58a327fc2e1c4d7a5610f5095 | 1,055 | py | Python | processing/gray-scale-processing.py | rsampaths16/ReRes | 51089c806c57087eb94d9a659036ebed88e96f13 | [
"Apache-2.0"
] | 2 | 2017-12-19T07:50:25.000Z | 2018-03-26T05:59:54.000Z | processing/gray-scale-processing.py | rsampaths16/ReRes | 51089c806c57087eb94d9a659036ebed88e96f13 | [
"Apache-2.0"
] | null | null | null | processing/gray-scale-processing.py | rsampaths16/ReRes | 51089c806c57087eb94d9a659036ebed88e96f13 | [
"Apache-2.0"
] | 1 | 2020-04-26T03:12:35.000Z | 2020-04-26T03:12:35.000Z | import numpy
import scipy
import glob
from matplotlib import pyplot
from scipy import misc
from numpy import random
random.seed(0)
SIZE = 128
ORIGINAL = '../data/offline-data/black-and-white-images/original'
HIGH = '../data/offline-data/black-and-white-images/train/high'
LOW = '../data/offline-data/black-and-white-ima... | 31.029412 | 65 | 0.649289 | import numpy
import scipy
import glob
from matplotlib import pyplot
from scipy import misc
from numpy import random
random.seed(0)
SIZE = 128
ORIGINAL = '../data/offline-data/black-and-white-images/original'
HIGH = '../data/offline-data/black-and-white-images/train/high'
LOW = '../data/offline-data/black-and-white-ima... | true | true |
f726b8d12a6a6783daf22dfc04e130655b135796 | 5,213 | py | Python | training_3DMatch.py | aosheng1996/D3Feat | d005f3811c12764c16d4f5e9a01c6720e7e72392 | [
"MIT"
] | 1 | 2020-05-11T15:49:34.000Z | 2020-05-11T15:49:34.000Z | training_3DMatch.py | aosheng1996/D3Feat | d005f3811c12764c16d4f5e9a01c6720e7e72392 | [
"MIT"
] | null | null | null | training_3DMatch.py | aosheng1996/D3Feat | d005f3811c12764c16d4f5e9a01c6720e7e72392 | [
"MIT"
] | null | null | null | # Common libs
import time
import os
import sys
# Custom libs
from utils.config import Config
from utils.trainer import ModelTrainer
from models.KPFCNN_model import KernelPointFCNN
# Dataset
from datasets.ThreeDMatch import ThreeDMatchDataset
# ------------------------------------------------------------------------... | 25.0625 | 120 | 0.531939 |
import time
import os
import sys
from utils.config import Config
from utils.trainer import ModelTrainer
from models.KPFCNN_model import KernelPointFCNN
from datasets.ThreeDMatch import ThreeDMatchDataset
class ThreeDMatchConfig(Config):
False
det_loss_weight = 1
offsets_... | true | true |
f726b9d13411d60ad6b93cfd0a6545aa3baa5701 | 367 | py | Python | tests/test_models.py | inmagik/django-rest-admin | 61c0d1a993ebcf144352e0ee0f916d9e63c1ccf7 | [
"BSD-3-Clause"
] | 15 | 2015-11-13T00:22:11.000Z | 2020-02-04T12:07:05.000Z | tests/test_models.py | inmagik/django-rest-admin | 61c0d1a993ebcf144352e0ee0f916d9e63c1ccf7 | [
"BSD-3-Clause"
] | null | null | null | tests/test_models.py | inmagik/django-rest-admin | 61c0d1a993ebcf144352e0ee0f916d9e63c1ccf7 | [
"BSD-3-Clause"
] | 5 | 2015-11-13T11:23:19.000Z | 2019-08-06T18:43:58.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
test_django-rest-admin
------------
Tests for `django-rest-admin` models module.
"""
from django.test import TestCase
from django_rest_admin import models
class TestDjango_rest_admin(TestCase):
def setUp(self):
pass
def test_something(self):
... | 14.115385 | 44 | 0.640327 |
from django.test import TestCase
from django_rest_admin import models
class TestDjango_rest_admin(TestCase):
def setUp(self):
pass
def test_something(self):
pass
def tearDown(self):
pass
| true | true |
f726b9d6bccaaeb47166b01a9fa17fc6f824bd62 | 3,497 | py | Python | pypureclient/flasharray/FA_2_11/models/maintenance_window_post.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_11/models/maintenance_window_post.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_11/models/maintenance_window_post.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.11
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from ... | 31.223214 | 408 | 0.571061 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.flasharray.FA_2_11 import models
class MaintenanceWindowPost(object):
swagger_types = {
'timeout': 'int'
}
attribute_map = {
'timeout': 'timeout'
}
... | true | true |
f726ba59f261a358f8d57550d94c95d42ecd6359 | 1,276 | py | Python | tests/util.py | ecoal95/saltfs | 4d2596794a70919c2887688d6d116f2f5bb5cf1e | [
"Apache-2.0",
"MIT"
] | 1 | 2021-01-07T18:49:38.000Z | 2021-01-07T18:49:38.000Z | tests/util.py | ecoal95/saltfs | 4d2596794a70919c2887688d6d116f2f5bb5cf1e | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/util.py | ecoal95/saltfs | 4d2596794a70919c2887688d6d116f2f5bb5cf1e | [
"Apache-2.0",
"MIT"
] | null | null | null | import os
RED = 31
GREEN = 32
BLUE = 34
MAGENTA = 35
def color(code, string):
return '\033[' + str(code) + 'm' + string + '\033[0m'
def display_path(path):
return color(MAGENTA, path)
def colon():
return color(BLUE, ':')
EXCLUDE_DIRS = ['.git', '.vagrant']
def project_path():
# One dirname fo... | 19.333333 | 67 | 0.630094 | import os
RED = 31
GREEN = 32
BLUE = 34
MAGENTA = 35
def color(code, string):
return '\033[' + str(code) + 'm' + string + '\033[0m'
def display_path(path):
return color(MAGENTA, path)
def colon():
return color(BLUE, ':')
EXCLUDE_DIRS = ['.git', '.vagrant']
def project_path():
project_dir... | true | true |
f726bab48ffce3b6ae7271247b2fa10be660d332 | 488 | py | Python | challenges/insertion/test_insertion.py | glasscharlie/data-structures-and-algorithms | 4546a0606334c6e3156b567d8cc82d39fb183c58 | [
"MIT"
] | null | null | null | challenges/insertion/test_insertion.py | glasscharlie/data-structures-and-algorithms | 4546a0606334c6e3156b567d8cc82d39fb183c58 | [
"MIT"
] | 4 | 2019-12-02T22:28:03.000Z | 2019-12-09T04:17:53.000Z | challenges/insertion/test_insertion.py | glasscharlie/data-structures-and-algorithms | 4546a0606334c6e3156b567d8cc82d39fb183c58 | [
"MIT"
] | null | null | null | from insertion import insertion
def test_unique_values():
lst = [8,4,23,42,16,15]
expected = [4,8,15,16,23,42]
actual = insertion(lst)
assert actual == expected
def test_duplicate_value():
lst = [8,4,23,42,16,15,8,23]
expected = [4,8,8,15,16,23,23,42]
actual = insertion(lst)
assert act... | 24.4 | 37 | 0.631148 | from insertion import insertion
def test_unique_values():
lst = [8,4,23,42,16,15]
expected = [4,8,15,16,23,42]
actual = insertion(lst)
assert actual == expected
def test_duplicate_value():
lst = [8,4,23,42,16,15,8,23]
expected = [4,8,8,15,16,23,23,42]
actual = insertion(lst)
assert act... | true | true |
f726bd9b22797e229793a51530000a11ef85bb1c | 3,516 | py | Python | src/dss/server/dss_logger.py | akraino-edge-stack/ta-distributed-state-server | bd5a0a173f1ae9c64782fbf47565cc26ed23b448 | [
"Apache-2.0"
] | null | null | null | src/dss/server/dss_logger.py | akraino-edge-stack/ta-distributed-state-server | bd5a0a173f1ae9c64782fbf47565cc26ed23b448 | [
"Apache-2.0"
] | null | null | null | src/dss/server/dss_logger.py | akraino-edge-stack/ta-distributed-state-server | bd5a0a173f1ae9c64782fbf47565cc26ed23b448 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Nokia
#
# 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, softwa... | 30.842105 | 106 | 0.614903 |
import sys
import logging
import logging.handlers
from dss.api import dss_error
class Logger:
levels = {'debug': logging.DEBUG,
'info': logging.INFO,
'warning': logging.WARNING,
'error': logging.error}
DEST_CONSOLE = 1
DEST_SYSLOG = 2
dests = {'cons... | true | true |
f726be4df3aac1b1ae5b316e7cceff2b07cb123a | 38 | py | Python | files2md/structure_objects/structurable_directory/__init__.py | KacperKotlewski/file_structure_to_markdown | aad0e1c80f88e0b3d079cf242d43fdc4b7a369f7 | [
"MIT"
] | 1 | 2020-02-22T00:41:04.000Z | 2020-02-22T00:41:04.000Z | files2md/structure_objects/structurable_directory/__init__.py | KacperKotlewski/file_structure_to_markdown | aad0e1c80f88e0b3d079cf242d43fdc4b7a369f7 | [
"MIT"
] | null | null | null | files2md/structure_objects/structurable_directory/__init__.py | KacperKotlewski/file_structure_to_markdown | aad0e1c80f88e0b3d079cf242d43fdc4b7a369f7 | [
"MIT"
] | null | null | null | from .directoryObj import DirectoryObj | 38 | 38 | 0.894737 | from .directoryObj import DirectoryObj | true | true |
f726be65d2d58a2e1ead974e840eb9718283079e | 335 | py | Python | database/table_objects/ping_targets.py | Timo-Meinhof/friedrich-py | 025e45fe23aba0980762af779161626477c567b0 | [
"MIT"
] | 1 | 2021-08-07T12:18:48.000Z | 2021-08-07T12:18:48.000Z | database/table_objects/ping_targets.py | Timo-Meinhof/friedrich-py | 025e45fe23aba0980762af779161626477c567b0 | [
"MIT"
] | null | null | null | database/table_objects/ping_targets.py | Timo-Meinhof/friedrich-py | 025e45fe23aba0980762af779161626477c567b0 | [
"MIT"
] | null | null | null | class User:
def __init__(self, id: str, name: str, color: str, studon: str):
self.id = id
self.name = name
self.color = color
self.studon = studon
class Role:
def __init__(self, id: str, name: str, color: str):
self.id = id
self.name = name
sel... | 27.916667 | 69 | 0.540299 | class User:
def __init__(self, id: str, name: str, color: str, studon: str):
self.id = id
self.name = name
self.color = color
self.studon = studon
class Role:
def __init__(self, id: str, name: str, color: str):
self.id = id
self.name = name
sel... | true | true |
f726bec39c5c25f3abb108a6dd36bed1b16fe8f7 | 12,303 | py | Python | lenstronomy/PointSource/point_source_types.py | franyancr/lenstronomy | 3a7b33512a474bf1796d23276d9028b580580cf1 | [
"MIT"
] | null | null | null | lenstronomy/PointSource/point_source_types.py | franyancr/lenstronomy | 3a7b33512a474bf1796d23276d9028b580580cf1 | [
"MIT"
] | null | null | null | lenstronomy/PointSource/point_source_types.py | franyancr/lenstronomy | 3a7b33512a474bf1796d23276d9028b580580cf1 | [
"MIT"
] | null | null | null | import numpy as np
from lenstronomy.LensModel.Solver.lens_equation_solver import LensEquationSolver
class Unlensed(object):
"""
class of a single point source in the image plane, aka star
parameters: ra_image, dec_image, point_amp
"""
def __init__(self):
pass
def image_position(self,... | 47.137931 | 231 | 0.599366 | import numpy as np
from lenstronomy.LensModel.Solver.lens_equation_solver import LensEquationSolver
class Unlensed(object):
def __init__(self):
pass
def image_position(self, kwargs_ps, kwargs_lens=None, **kwargs):
ra_image = kwargs_ps['ra_image']
dec_image = kwargs_ps['dec_image']
... | true | true |
f726bf47700172a8e614d87926cc30cfdb491818 | 2,508 | py | Python | linkedlist.py | jerrybelmonte/DataStructures-Python | 553a156f685d83291e73e0c35b85167e6b114379 | [
"MIT"
] | null | null | null | linkedlist.py | jerrybelmonte/DataStructures-Python | 553a156f685d83291e73e0c35b85167e6b114379 | [
"MIT"
] | null | null | null | linkedlist.py | jerrybelmonte/DataStructures-Python | 553a156f685d83291e73e0c35b85167e6b114379 | [
"MIT"
] | null | null | null | # LinkedList implementation using a helper Element class
class Element(object):
def __init__(self, value):
self.value = value
self.next = None
class LinkedList(object):
def __init__(self, head=None):
self.head = head
def append(self, new_element):
current = self.head
... | 25.591837 | 56 | 0.555821 |
class Element(object):
def __init__(self, value):
self.value = value
self.next = None
class LinkedList(object):
def __init__(self, head=None):
self.head = head
def append(self, new_element):
current = self.head
if self.head:
while current.next:
... | true | true |
f726c0fcd2d691576e784c9f9ad8d9f54ceb42ec | 4,000 | py | Python | benchmarks/supervectorizer_tuning.py | dirty-cat/categorical-encoding | fb0a1c4216533034e7516efc0698c7e4477b0243 | [
"BSD-3-Clause"
] | 374 | 2018-03-16T09:00:55.000Z | 2022-03-31T14:07:43.000Z | benchmarks/supervectorizer_tuning.py | dirty-cat/categorical-encoding | fb0a1c4216533034e7516efc0698c7e4477b0243 | [
"BSD-3-Clause"
] | 195 | 2018-03-14T13:56:25.000Z | 2022-03-31T11:49:49.000Z | benchmarks/supervectorizer_tuning.py | dirty-cat/categorical-encoding | fb0a1c4216533034e7516efc0698c7e4477b0243 | [
"BSD-3-Clause"
] | 52 | 2018-03-13T13:23:01.000Z | 2022-03-17T09:56:56.000Z | """
Performs a GridSearch to find the best parameters for the SuperVectorizer
among a selection.
"""
import logging
import pandas as pd
from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.pipeline import Pipeline
from dirty_cat impo... | 29.850746 | 88 | 0.6265 |
import logging
import pandas as pd
from sklearn.ensemble import RandomForestRegressor, RandomForestClassifier
from sklearn.model_selection import GridSearchCV
from sklearn.pipeline import Pipeline
from dirty_cat import SuperVectorizer
from dirty_cat.datasets import fetch_open_payments, fetch_drug_directory, \
fe... | true | true |
f726c100e03118fe63b2ed7bad2293c84c8e95ee | 282 | py | Python | scripts/batch_stop.py | oretoise/slate | cfbf629417680cd0fe6d745f7d8a50275aef00a9 | [
"MIT"
] | null | null | null | scripts/batch_stop.py | oretoise/slate | cfbf629417680cd0fe6d745f7d8a50275aef00a9 | [
"MIT"
] | null | null | null | scripts/batch_stop.py | oretoise/slate | cfbf629417680cd0fe6d745f7d8a50275aef00a9 | [
"MIT"
] | null | null | null | import pyautogui
pyautogui.PAUSE = 5
while True:
# Click first email in list.
pyautogui.click(640, 345)
# Stop it
pyautogui.click(1760, 430)
pyautogui.click(980, 1020)
pyautogui.typewrite("STOP")
pyautogui.press('enter')
pyautogui.click(580, 220) | 18.8 | 32 | 0.670213 | import pyautogui
pyautogui.PAUSE = 5
while True:
pyautogui.click(640, 345)
pyautogui.click(1760, 430)
pyautogui.click(980, 1020)
pyautogui.typewrite("STOP")
pyautogui.press('enter')
pyautogui.click(580, 220) | true | true |
f726c15fd0c5805fefb311e2ad443ac3c19afea2 | 802 | py | Python | manage.py | guanqingqi/dove | f8681f144e44369bf9e0c9ea76e1994920a14cfb | [
"Apache-2.0"
] | null | null | null | manage.py | guanqingqi/dove | f8681f144e44369bf9e0c9ea76e1994920a14cfb | [
"Apache-2.0"
] | null | null | null | manage.py | guanqingqi/dove | f8681f144e44369bf9e0c9ea76e1994920a14cfb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dove.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... | 34.869565 | 77 | 0.640898 |
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dove.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
try:
import django
except ImportError:
... | true | true |
f726c164a1629b8cd7489e23860a47602ec42ab6 | 13,533 | py | Python | ph5/utilities/dumpsgy.py | kujaku11/PH5_py3 | bd0ae3be843bae70f08b03d3d95913473288c3a6 | [
"MIT"
] | null | null | null | ph5/utilities/dumpsgy.py | kujaku11/PH5_py3 | bd0ae3be843bae70f08b03d3d95913473288c3a6 | [
"MIT"
] | null | null | null | ph5/utilities/dumpsgy.py | kujaku11/PH5_py3 | bd0ae3be843bae70f08b03d3d95913473288c3a6 | [
"MIT"
] | null | null | null | #!/usr/bin/env pnpython3
#
# Simple program to read and display SEG-Y file
#
# Steve Azevedo
#
import argparse
import logging
import os
from ph5.core import segy_h, ibmfloat, ebcdic
import construct
PROG_VERSION = '2019.14'
LOGGER = logging.getLogger(__name__)
SAMPLE_LENGTH = {1: 4, 2: 4, 3: 2, 4: 4, 5: 4, 8: 1}
S... | 31.545455 | 79 | 0.495677 |
import argparse
import logging
import os
from ph5.core import segy_h, ibmfloat, ebcdic
import construct
PROG_VERSION = '2019.14'
LOGGER = logging.getLogger(__name__)
SAMPLE_LENGTH = {1: 4, 2: 4, 3: 2, 4: 4, 5: 4, 8: 1}
SIZEOF = {"lineSeq": 32, "reelSeq": 32, "event_number": 32,
"channel_number": 32... | false | true |
f726c16c09d5ab1fb493fbccc82d1e44044c2174 | 11,918 | py | Python | flan/export.py | bretlowery/flan | b79319044fcdb2230ac090232e9056719cb09f17 | [
"MIT"
] | 3 | 2019-08-03T13:27:31.000Z | 2021-06-08T16:25:31.000Z | flan/export.py | bretlowery/flan | b79319044fcdb2230ac090232e9056719cb09f17 | [
"MIT"
] | 2 | 2020-09-24T10:44:55.000Z | 2021-06-25T15:31:24.000Z | flan/export.py | bretlowery/flan | b79319044fcdb2230ac090232e9056719cb09f17 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2012 Splunk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"): you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 32.38587 | 84 | 0.601275 |
from __future__ import absolute_import
from __future__ import print_function
import sys, os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", ".."))
import time
from os import path
from splunklib.binding import connect
try:
from utils import parse
except ImportError:
raise E... | true | true |
f726c1895f87278ef2674e56273fb6b067545c0c | 392 | py | Python | python/python_backup/PRAC_PYTHON/dc.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 16 | 2018-11-26T08:39:42.000Z | 2019-05-08T10:09:52.000Z | python/python_backup/PRAC_PYTHON/dc.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 8 | 2020-05-04T06:29:26.000Z | 2022-02-12T05:33:16.000Z | python/python_backup/PRAC_PYTHON/dc.py | SayanGhoshBDA/code-backup | 8b6135facc0e598e9686b2e8eb2d69dd68198b80 | [
"MIT"
] | 5 | 2020-02-11T16:02:21.000Z | 2021-02-05T07:48:30.000Z | class palindrome:
def __init__(self):
self.a=""
def input(self,k1):
self.a=k1
def calculate(self):
f=0
j=len(k1)-1
while i<len(k1)/2:
if k1[i]!=k1[j]:
f=1
else:
i=i+1
j=j-1
if f==0:
print "self.a is palindrome"
else:
print "self.a is not a palindro... | 17.818182 | 38 | 0.545918 | class palindrome:
def __init__(self):
self.a=""
def input(self,k1):
self.a=k1
def calculate(self):
f=0
j=len(k1)-1
while i<len(k1)/2:
if k1[i]!=k1[j]:
f=1
else:
i=i+1
j=j-1
if f==0:
print "self.a is palindrome"
else:
print "self.a is not a palindro... | false | true |
f726c1f060b031498baf48c9527e53700f69bbf2 | 6,961 | py | Python | virt/ansible-latest/lib/python2.7/site-packages/ansible/modules/network/aos/_aos_device.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | 1 | 2020-03-29T18:41:01.000Z | 2020-03-29T18:41:01.000Z | ansible/ansible/modules/network/aos/_aos_device.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 7 | 2020-09-07T17:27:56.000Z | 2022-03-02T06:25:46.000Z | ansible/ansible/modules/network/aos/_aos_device.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 1 | 2020-03-22T01:04:48.000Z | 2020-03-22T01:04:48.000Z | #!/usr/bin/python
#
# (c) 2017 Apstra Inc, <community@apstra.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opt... | 31.215247 | 119 | 0.598046 |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['deprecated'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: aos_device
author: Damien Garros (@dgarros)
version_added: "2.3"
short_description: Manage Devices on AOS Server
deprecated:... | true | true |
f726c272489e3dc1390d84faaafa96fc0f0468af | 6,064 | py | Python | py/featureExtractor.py | Anthony2018/Speech-Enhancement | 9cd0ba6456b946152c17bbccf7c7adaf251a7598 | [
"MIT"
] | null | null | null | py/featureExtractor.py | Anthony2018/Speech-Enhancement | 9cd0ba6456b946152c17bbccf7c7adaf251a7598 | [
"MIT"
] | null | null | null | py/featureExtractor.py | Anthony2018/Speech-Enhancement | 9cd0ba6456b946152c17bbccf7c7adaf251a7598 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import pandas as pd
import re
import scipy.stats as stats
from scipy.io import wavfile
import numpy as np
import os
raw_folder = './raw'
pattern_date = re.compile('[0-9]{8}')
female_pattern = re.compile('[Ff]emale')
male_pattern = re.compile('[Mm]ale')
american_pattern = r... | 32.602151 | 137 | 0.685686 |
import pandas as pd
import re
import scipy.stats as stats
from scipy.io import wavfile
import numpy as np
import os
raw_folder = './raw'
pattern_date = re.compile('[0-9]{8}')
female_pattern = re.compile('[Ff]emale')
male_pattern = re.compile('[Mm]ale')
american_pattern = re.compile('[Aa]merican')
british_pattern... | false | true |
f726c4efcbe41267a6d7cd4f11809971061e72b5 | 15,902 | py | Python | python/ccxt/async_support/base/exchange.py | halfjuice/ccxt | cc702efbaafba547c3bc973895bd817b3308d072 | [
"MIT"
] | null | null | null | python/ccxt/async_support/base/exchange.py | halfjuice/ccxt | cc702efbaafba547c3bc973895bd817b3308d072 | [
"MIT"
] | null | null | null | python/ccxt/async_support/base/exchange.py | halfjuice/ccxt | cc702efbaafba547c3bc973895bd817b3308d072 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
__version__ = '1.61.55'
# -----------------------------------------------------------------------------
import asyncio
import concurrent.futures
import socket
import certifi
import aiohttp
import ssl
import sys
i... | 43.807163 | 355 | 0.617029 |
__version__ = '1.61.55'
import asyncio
import concurrent.futures
import socket
import certifi
import aiohttp
import ssl
import sys
import yarl
from ccxt.async_support.base.throttler import Throttler
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ExchangeNotAvailable
from ccxt.base.... | true | true |
f726c5d759f5490c1ae882cd36b4a8678f29a3ed | 4,451 | py | Python | dark/process.py | UdoGi/dark-matter | 3d49e89fa5e81f83144119f6216c5774176d203b | [
"MIT"
] | 10 | 2016-03-09T09:43:14.000Z | 2021-04-03T21:46:12.000Z | dark/process.py | terrycojones/dark-matter | 67d16f870db6b4239e17e542bc6e3f072dc29c75 | [
"MIT"
] | 332 | 2015-01-07T12:37:30.000Z | 2022-01-20T15:48:11.000Z | dark/process.py | terrycojones/dark-matter | 67d16f870db6b4239e17e542bc6e3f072dc29c75 | [
"MIT"
] | 4 | 2016-03-08T14:56:39.000Z | 2021-01-27T08:11:27.000Z | from __future__ import division, print_function
import six
from time import time, ctime
from subprocess import PIPE, CalledProcessError
if six.PY3:
from subprocess import run
else:
from subprocess import check_call
class Executor(object):
"""
Log and execute shell commands.
@param dryRun: If C{... | 38.37069 | 79 | 0.560324 | from __future__ import division, print_function
import six
from time import time, ctime
from subprocess import PIPE, CalledProcessError
if six.PY3:
from subprocess import run
else:
from subprocess import check_call
class Executor(object):
def __init__(self, dryRun=False):
self.dryRun = dryRun
... | true | true |
f726c61ee010e4614285c7fc75b5c47cb8f51c57 | 318 | py | Python | Preprocessing/scripts/dec_user_id.py | udhavsethi/contentNCF | d11273956bf9c793eb616cde9c3da01c70e5403b | [
"Apache-2.0"
] | 2 | 2021-09-16T02:14:57.000Z | 2022-02-02T01:16:26.000Z | Preprocessing/scripts/dec_user_id.py | udhavsethi/contentNCF | d11273956bf9c793eb616cde9c3da01c70e5403b | [
"Apache-2.0"
] | null | null | null | Preprocessing/scripts/dec_user_id.py | udhavsethi/contentNCF | d11273956bf9c793eb616cde9c3da01c70e5403b | [
"Apache-2.0"
] | null | null | null | infile = open('500_users_to_images.train', 'r')
outfile = open('pinterest.data', 'w')
for line in infile.readlines():
user_id, img_id, img_url = line.strip().split('\t')
dec_user_id = str(int(user_id) - 1)
outfile.write("{}\t{}\t{}\n".format(dec_user_id, img_id, img_url))
infile.close()
outfile.close()
| 28.909091 | 70 | 0.666667 | infile = open('500_users_to_images.train', 'r')
outfile = open('pinterest.data', 'w')
for line in infile.readlines():
user_id, img_id, img_url = line.strip().split('\t')
dec_user_id = str(int(user_id) - 1)
outfile.write("{}\t{}\t{}\n".format(dec_user_id, img_id, img_url))
infile.close()
outfile.close()
| true | true |
f726c69eef6c7661033f52ac8cc3885f33c80910 | 686 | py | Python | app/core/migrations/0003_ingredient.py | amaurycoudr/recipe-app-api | ab4da3d5553230d9b15ddc6f97091e3f01cc348e | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingredient.py | amaurycoudr/recipe-app-api | ab4da3d5553230d9b15ddc6f97091e3f01cc348e | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingredient.py | amaurycoudr/recipe-app-api | ab4da3d5553230d9b15ddc6f97091e3f01cc348e | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2020-08-24 07:56
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
... | 28.583333 | 118 | 0.618076 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0002_tag'),
]
operations = [
migrations.CreateModel(
name='Ingredient',
fields=[
... | true | true |
f726c7af66c2d6b8cae93c16306362700e6e476b | 2,702 | py | Python | examples/face_recognition_svm.py | viettriit2110/face_recognition | 0e1821af6538c573ed4a87acc361c44900f849eb | [
"MIT"
] | 2 | 2019-11-12T06:22:45.000Z | 2019-11-12T14:30:00.000Z | examples/face_recognition_svm.py | viettriit2110/face_recognition | 0e1821af6538c573ed4a87acc361c44900f849eb | [
"MIT"
] | null | null | null | examples/face_recognition_svm.py | viettriit2110/face_recognition | 0e1821af6538c573ed4a87acc361c44900f849eb | [
"MIT"
] | null | null | null | # Train multiple images per person
# Find and recognize faces in an image using a SVC with scikit-learn
"""
Structure:
<test_image>.jpg
<train_dir>/
<person_1>/
<person_1_face-1>.jpg
<person_1_face-2>.jpg
.
.
... | 33.358025 | 119 | 0.611769 |
import face_recognition
from sklearn import svm
import os
encodings = []
names = []
train_dir = os.listdir('/train_dir/')
for person in train_dir:
pix = os.listdir("/train_dir/" + person)
for person_img in pix:
face = face_recognition.load_image_file("/train_di... | true | true |
f726c7e3f9f0e96210a1b6a0a5aa57076aacdff1 | 17,093 | py | Python | aldryn_newsblog/south_migrations/0010_auto__add_unique_articletranslation_language_code_slug__del_field_arti.py | what-digital/aldryn-newsblog-blog-teaser-size | c52cb256fe3b608838f2184de9575b6cbbfd5f8e | [
"BSD-3-Clause"
] | null | null | null | aldryn_newsblog/south_migrations/0010_auto__add_unique_articletranslation_language_code_slug__del_field_arti.py | what-digital/aldryn-newsblog-blog-teaser-size | c52cb256fe3b608838f2184de9575b6cbbfd5f8e | [
"BSD-3-Clause"
] | null | null | null | aldryn_newsblog/south_migrations/0010_auto__add_unique_articletranslation_language_code_slug__del_field_arti.py | what-digital/aldryn-newsblog-blog-teaser-size | c52cb256fe3b608838f2184de9575b6cbbfd5f8e | [
"BSD-3-Clause"
] | 2 | 2019-10-22T04:30:28.000Z | 2019-10-22T05:09:16.000Z | # -*- 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
from aldryn_newsblog.utils.migration import rename_tables_old_to_new, rename_tables_new_to_old
class Migration(SchemaMigration):
def forwards(self,... | 83.789216 | 195 | 0.572398 |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from aldryn_newsblog.utils.migration import rename_tables_old_to_new, rename_tables_new_to_old
class Migration(SchemaMigration):
def forwards(self, orm):
rename_t... | true | true |
f726c922dcd0dfb1fe6fe59bdb40b901325c9e0a | 33,645 | py | Python | ambassador/ambassador/config/resourcefetcher.py | Andrei-Predoiu/ambassador | efbd0ac8d65e36eab68997051167bc3eea165f35 | [
"Apache-2.0"
] | null | null | null | ambassador/ambassador/config/resourcefetcher.py | Andrei-Predoiu/ambassador | efbd0ac8d65e36eab68997051167bc3eea165f35 | [
"Apache-2.0"
] | null | null | null | ambassador/ambassador/config/resourcefetcher.py | Andrei-Predoiu/ambassador | efbd0ac8d65e36eab68997051167bc3eea165f35 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict, List, Optional, Tuple, TYPE_CHECKING
# from typing import cast as typecast
import json
import logging
import os
import yaml
from .config import Config
from .acresource import ACResource
from ..utils import parse_yaml, dump_yaml
AnyDict = Dict[str, Any]
HandlerResult = Optional[Tuple[st... | 41.332924 | 286 | 0.575895 | from typing import Any, Dict, List, Optional, Tuple, TYPE_CHECKING
import json
import logging
import os
import yaml
from .config import Config
from .acresource import ACResource
from ..utils import parse_yaml, dump_yaml
AnyDict = Dict[str, Any]
HandlerResult = Optional[Tuple[str, List[AnyDict]]]
# resources,... | true | true |
f726c946b28663f6039c3f5e99cf5aef3b6ee900 | 302 | py | Python | pyexcel/sheets/__init__.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2022-01-25T22:52:58.000Z | 2022-01-25T22:52:58.000Z | pyexcel/sheets/__init__.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | pyexcel/sheets/__init__.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | """
pyexcel.sheets
~~~~~~~~~~~~~~~~~~~
Core functionality of pyexcel, data model
:copyright: (c) 2014-2017 by Onni Software Ltd.
:license: New BSD License, see LICENSE for more details
"""
# flake8: noqa
from .sheet import Sheet
from .matrix import Matrix, transpose, Row, Column
| 23.230769 | 59 | 0.652318 |
from .sheet import Sheet
from .matrix import Matrix, transpose, Row, Column
| true | true |
f726caa23a352acc6478111d0682e07e79f4858c | 860 | py | Python | route/main_file.py | LiteHell/openNAMU | 72bd1ec1d4b63bd74876bf1c4bb3c4002ec9fdd1 | [
"BSD-3-Clause"
] | null | null | null | route/main_file.py | LiteHell/openNAMU | 72bd1ec1d4b63bd74876bf1c4bb3c4002ec9fdd1 | [
"BSD-3-Clause"
] | null | null | null | route/main_file.py | LiteHell/openNAMU | 72bd1ec1d4b63bd74876bf1c4bb3c4002ec9fdd1 | [
"BSD-3-Clause"
] | null | null | null | from .tool.func import *
from . import main_error_404
def main_file_2(conn, data):
curs = conn.cursor()
if data == 'easter_egg.html':
return easy_minify(flask.render_template(skin_check(),
imp = ['easter_egg.html', wiki_set(), custom(), other2([0, 0])],
data = open('./views/mai... | 40.952381 | 109 | 0.603488 | from .tool.func import *
from . import main_error_404
def main_file_2(conn, data):
curs = conn.cursor()
if data == 'easter_egg.html':
return easy_minify(flask.render_template(skin_check(),
imp = ['easter_egg.html', wiki_set(), custom(), other2([0, 0])],
data = open('./views/mai... | true | true |
f726cb978618b466b6e7a32b01c4590b62b5c7a6 | 3,077 | py | Python | commons/__init__.py | oeg-upm/ttla | ab1cc5a2777b3d4fb905f4452379f469153c904b | [
"Apache-2.0"
] | null | null | null | commons/__init__.py | oeg-upm/ttla | ab1cc5a2777b3d4fb905f4452379f469153c904b | [
"Apache-2.0"
] | 5 | 2019-04-03T12:58:29.000Z | 2021-06-02T00:18:34.000Z | commons/__init__.py | oeg-upm/bob | ab1cc5a2777b3d4fb905f4452379f469153c904b | [
"Apache-2.0"
] | null | null | null | import os
import pandas as pd
from easysparql import *
ENDPOINT = "https://dbpedia.org/sparql"
MIN_NUM_OF_ENT_PER_PROP = 30 # the minimum number of entities per property (get_properties)
QUERY_LIMIT = "" # At the moment, we do not put any limit on the number of results
MIN_NUM_NUMS = 30 # The minimum number of valu... | 26.756522 | 102 | 0.646409 | import os
import pandas as pd
from easysparql import *
ENDPOINT = "https://dbpedia.org/sparql"
MIN_NUM_OF_ENT_PER_PROP = 30
QUERY_LIMIT = ""
MIN_NUM_NUMS = 30
proj_path = (os.path.join(os.path.dirname(os.path.realpath(__file__)), os.pardir))
data_dir = os.path.join(proj_path, 'data')
meta_dir = os.path.join(pr... | true | true |
f726cc74ea48e6d84a1083f2a64bd4568a8f55c4 | 8,841 | py | Python | tools/pkg/tmpl.py | kristoffer-paulsson/angelos | 2ec236770d6530884a8ad88505aab01183f752b4 | [
"MIT"
] | 8 | 2020-06-07T23:26:34.000Z | 2022-03-28T00:20:34.000Z | tools/pkg/tmpl.py | kristoffer-paulsson/angelos | 2ec236770d6530884a8ad88505aab01183f752b4 | [
"MIT"
] | 1 | 2019-12-24T22:06:02.000Z | 2020-07-12T19:18:57.000Z | tools/pkg/tmpl.py | kristoffer-paulsson/angelos | 2ec236770d6530884a8ad88505aab01183f752b4 | [
"MIT"
] | null | null | null | #
# Copyright (c) 2018-2020 by Kristoffer Paulsson <kristoffer.paulsson@talenten.se>.
#
# This software is available under the terms of the MIT license. Parts are licensed under
# different terms if stated. The legal terms are attached to the LICENSE file and are
# made available on:
#
# https://opensource.org/lice... | 26.54955 | 121 | 0.679222 |
import datetime
import os
import re
import shutil
from pathlib import Path
from .data import NAME_NIX, VERSION, LICENSE, URL, PERMS_DIR, PERMS_EXEC, PERMS_FILE, EXEC_PREFIX, DIR_ANGELOS, \
FILE_ENV, FILE_CONF, FILE_EXE, USERNAME, GROUPNAME, NAME_SERVICE, DIR_VAR, DIR_LOG, DIR_ETC, FILE_ADMINS, LINK_E... | true | true |
f726cc8a8a3084e57b5bf0e9e1bfcc87faa21241 | 6,494 | py | Python | dvc/stage/serialize.py | asford/dvc | 4ed55d00511ea3d9115b76c463e1a466408b11ef | [
"Apache-2.0"
] | 1 | 2021-06-18T19:36:13.000Z | 2021-06-18T19:36:13.000Z | dvc/stage/serialize.py | asford/dvc | 4ed55d00511ea3d9115b76c463e1a466408b11ef | [
"Apache-2.0"
] | 82 | 2021-05-04T02:40:05.000Z | 2022-03-31T03:14:04.000Z | dvc/stage/serialize.py | asford/dvc | 4ed55d00511ea3d9115b76c463e1a466408b11ef | [
"Apache-2.0"
] | 2 | 2021-06-14T19:12:25.000Z | 2021-06-14T19:12:29.000Z | from collections import OrderedDict
from functools import partial
from operator import attrgetter
from typing import TYPE_CHECKING, List, no_type_check
from funcy import post_processing
from dvc.dependency import ParamsDependency
from dvc.output import BaseOutput
from dvc.utils.collections import apply_diff
from dvc.... | 31.221154 | 79 | 0.665075 | from collections import OrderedDict
from functools import partial
from operator import attrgetter
from typing import TYPE_CHECKING, List, no_type_check
from funcy import post_processing
from dvc.dependency import ParamsDependency
from dvc.output import BaseOutput
from dvc.utils.collections import apply_diff
from dvc.... | true | true |
f726cca87b9b1703027d92c330e14876f773484c | 8,401 | py | Python | mmdet/models/losses/my_cross_entropy_loss.py | dyabel/wsod-mmdet | 60fc1993ea298f992b160b5599a6134702ac0d4f | [
"Apache-2.0"
] | 6 | 2021-10-09T05:34:04.000Z | 2022-03-31T00:36:55.000Z | mmdet/models/losses/my_cross_entropy_loss.py | dyabel/wsod-mmdet | 60fc1993ea298f992b160b5599a6134702ac0d4f | [
"Apache-2.0"
] | null | null | null | mmdet/models/losses/my_cross_entropy_loss.py | dyabel/wsod-mmdet | 60fc1993ea298f992b160b5599a6134702ac0d4f | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from ..builder import LOSSES
from .utils import weight_reduce_loss
eps = 0.000001
def cross_entropy_without_softmax(pred,
label,
weight=None,
... | 36.055794 | 79 | 0.59612 | import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from ..builder import LOSSES
from .utils import weight_reduce_loss
eps = 0.000001
def cross_entropy_without_softmax(pred,
label,
weight=None,
... | true | true |
f726ce223abc85e16691c9ec990fbe29a1aa1ef0 | 400 | py | Python | sys_monitor/wsgi.py | PeterXUYAOHAI/System_Monitor | 2b78107a7f87e13ebab38ea5a89c870ef5415fd2 | [
"MIT"
] | 2 | 2018-05-07T03:30:55.000Z | 2018-05-10T11:27:18.000Z | sys_monitor/wsgi.py | PeterXUYAOHAI/System_Monitor | 2b78107a7f87e13ebab38ea5a89c870ef5415fd2 | [
"MIT"
] | null | null | null | sys_monitor/wsgi.py | PeterXUYAOHAI/System_Monitor | 2b78107a7f87e13ebab38ea5a89c870ef5415fd2 | [
"MIT"
] | null | null | null | """
WSGI config for sys_monitor project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_... | 23.529412 | 78 | 0.79 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "sys_monitor.settings")
application = get_wsgi_application()
| true | true |
f726cee2a25f6da66c15f0d51afb12dd8579d0fe | 6,439 | py | Python | python/oneflow/nn/optimizer/sgd.py | grybd/oneflow | 82237ad096a10527591660c09b61444c42917e69 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/nn/optimizer/sgd.py | grybd/oneflow | 82237ad096a10527591660c09b61444c42917e69 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/nn/optimizer/sgd.py | grybd/oneflow | 82237ad096a10527591660c09b61444c42917e69 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 33.362694 | 131 | 0.55226 | import collections
from typing import Callable, Dict, Iterator, List, Union
import oneflow as flow
from oneflow.nn.parameter import Parameter
from .optimizer import Optimizer, ParamGroup
class SGD(Optimizer):
def __init__(
self,
parameters: Union[Iterator[Parameter], List[Dict]],
lr: fl... | true | true |
f726cff10848dfee859add52644fda3f040aa102 | 966 | py | Python | nms/benchmark/nms_numba_cpu.py | ForrestPi/ObjectDetection | 54e0821e73f67be5360c36f01229a123c34ab3b3 | [
"MIT"
] | 12 | 2020-03-25T01:24:22.000Z | 2021-09-18T06:40:16.000Z | nms/benchmark/nms_numba_cpu.py | ForrestPi/ObjectDetection | 54e0821e73f67be5360c36f01229a123c34ab3b3 | [
"MIT"
] | 1 | 2020-04-22T07:52:36.000Z | 2020-04-22T07:52:36.000Z | nms/benchmark/nms_numba_cpu.py | ForrestPi/ObjectDetection | 54e0821e73f67be5360c36f01229a123c34ab3b3 | [
"MIT"
] | 4 | 2020-03-25T01:24:26.000Z | 2020-09-20T11:29:09.000Z | from __future__ import absolute_import
import numba
import numpy as np
@numba.jit(nopython=True)
def nms_cpu(dets, thresh):
x1 = dets[:, 0]
y1 = dets[:, 1]
x2 = dets[:, 2]
y2 = dets[:, 3]
scores = dets[:, 4]
areas = (x2 - x1 + 1) * (y2 - y1 + 1)
order = scores.argsort()[::-1]
keep = []
... | 25.421053 | 59 | 0.519669 | from __future__ import absolute_import
import numba
import numpy as np
@numba.jit(nopython=True)
def nms_cpu(dets, thresh):
x1 = dets[:, 0]
y1 = dets[:, 1]
x2 = dets[:, 2]
y2 = dets[:, 3]
scores = dets[:, 4]
areas = (x2 - x1 + 1) * (y2 - y1 + 1)
order = scores.argsort()[::-1]
keep = []
... | true | true |
f726d15285b7c2f6ec452d3585c75aaddfd2bc1d | 594 | py | Python | examples/vagrant_todo/provision/recipes/project.py | avladev/pypro | 7eb98c5ebd9830104689d105c36424b24c72b475 | [
"MIT"
] | null | null | null | examples/vagrant_todo/provision/recipes/project.py | avladev/pypro | 7eb98c5ebd9830104689d105c36424b24c72b475 | [
"MIT"
] | null | null | null | examples/vagrant_todo/provision/recipes/project.py | avladev/pypro | 7eb98c5ebd9830104689d105c36424b24c72b475 | [
"MIT"
] | 1 | 2019-07-15T21:35:03.000Z | 2019-07-15T21:35:03.000Z | import pypro.core
import os
class CreateConfig(pypro.core.Recipe):
def __init__(self, source, destination):
self.source = source
self.destination = destination
def run(self, runner, arguments=None):
# Read the template file
content = ''
with open(self.source, 'r') as ... | 27 | 58 | 0.622896 | import pypro.core
import os
class CreateConfig(pypro.core.Recipe):
def __init__(self, source, destination):
self.source = source
self.destination = destination
def run(self, runner, arguments=None):
content = ''
with open(self.source, 'r') as f:
content =... | true | true |
f726d1ac18979248f061387ecccea5858da651fb | 974 | py | Python | for python/data/ggiramahor/pframe.py | aerolalit/Auto-Testing-Python-Programs | dd49ab266c9f0fd8e34278f68f8af017711942e3 | [
"MIT"
] | 4 | 2019-10-03T21:16:51.000Z | 2019-10-04T01:28:08.000Z | for python/data/ggiramahor/pframe.py | aerolalit/Auto-Testing | dd49ab266c9f0fd8e34278f68f8af017711942e3 | [
"MIT"
] | null | null | null | for python/data/ggiramahor/pframe.py | aerolalit/Auto-Testing | dd49ab266c9f0fd8e34278f68f8af017711942e3 | [
"MIT"
] | null | null | null | #350111
#a3-p10.py
#Gloria Giramahoro
#g.giramahoro@jacobs-university.de
#1.defining a function that prints a rectangle made of a character
def print_frame(n,m,c):
count = 1
if (n >= m):
product1 = n*c
print (product1)
for count in range(1,m-1):
words1 = str(' ')
... | 22.651163 | 67 | 0.532854 |
def print_frame(n,m,c):
count = 1
if (n >= m):
product1 = n*c
print (product1)
for count in range(1,m-1):
words1 = str(' ')
words = (n-4)*words1
print (c,words,c)
count = count+1
print (product1)
else :
... | true | true |
f726d1cf94494190573638e38a30c1c86a608bae | 595 | py | Python | next-permutation/next-permutation.py | gashev/algorithms | ea750b84658e282afad9db3cd51081e30521074b | [
"Unlicense"
] | 1 | 2020-07-23T21:33:43.000Z | 2020-07-23T21:33:43.000Z | next-permutation/next-permutation.py | gashev/algorithms | ea750b84658e282afad9db3cd51081e30521074b | [
"Unlicense"
] | null | null | null | next-permutation/next-permutation.py | gashev/algorithms | ea750b84658e282afad9db3cd51081e30521074b | [
"Unlicense"
] | null | null | null | def nextPermutation(numbers):
size = len(numbers)
tmp = len(numbers) - 1
while (tmp >= 0) and (numbers[tmp - 1] > numbers[tmp]):
tmp -= 1
if (not tmp):
return False
i = tmp - 1
tmp = size - 1
while (tmp > i) and (numbers[tmp] < numbers[i]):
tmp -= 1
j = tmp
... | 18.030303 | 59 | 0.494118 | def nextPermutation(numbers):
size = len(numbers)
tmp = len(numbers) - 1
while (tmp >= 0) and (numbers[tmp - 1] > numbers[tmp]):
tmp -= 1
if (not tmp):
return False
i = tmp - 1
tmp = size - 1
while (tmp > i) and (numbers[tmp] < numbers[i]):
tmp -= 1
j = tmp
... | false | true |
f726d2195174ef150cf9c6dca642b46141ce4e9e | 13,720 | py | Python | demystifying/feature_extraction/mlp_feature_extractor.py | delemottelab/demystifying | e8527b52d5fbe0570cd391921ecda5aefceb797a | [
"MIT"
] | 16 | 2020-01-04T14:46:03.000Z | 2021-07-10T05:54:05.000Z | demystifying/feature_extraction/mlp_feature_extractor.py | delemottelab/demystifying | e8527b52d5fbe0570cd391921ecda5aefceb797a | [
"MIT"
] | 11 | 2020-01-10T16:18:17.000Z | 2022-03-20T09:53:33.000Z | demystifying/feature_extraction/mlp_feature_extractor.py | delemottelab/demystifying | e8527b52d5fbe0570cd391921ecda5aefceb797a | [
"MIT"
] | 3 | 2020-03-16T04:35:01.000Z | 2022-02-10T12:39:01.000Z | from __future__ import absolute_import, division, print_function
import logging
import sys
logging.basicConfig(
stream=sys.stdout,
format='%(asctime)s %(name)s-%(levelname)s: %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
import numpy as np
from sklearn.neural_network import MLPClassifier, MLPRegressor
from ... | 52.769231 | 183 | 0.624344 | from __future__ import absolute_import, division, print_function
import logging
import sys
logging.basicConfig(
stream=sys.stdout,
format='%(asctime)s %(name)s-%(levelname)s: %(message)s',
datefmt='%Y-%m-%d %H:%M:%S')
import numpy as np
from sklearn.neural_network import MLPClassifier, MLPRegressor
from ... | true | true |
f726d5a556fdd6e0a03f5723767785d9c1e98fa3 | 2,358 | py | Python | parallelization/collect.py | allisonChilton/Reed-Solomon | 62c367ba44940df24c7dfa23331e491f35607abc | [
"MIT"
] | null | null | null | parallelization/collect.py | allisonChilton/Reed-Solomon | 62c367ba44940df24c7dfa23331e491f35607abc | [
"MIT"
] | null | null | null | parallelization/collect.py | allisonChilton/Reed-Solomon | 62c367ba44940df24c7dfa23331e491f35607abc | [
"MIT"
] | null | null | null | import sys
import os
import subprocess
import re
import time
from dataclasses import dataclass
from typing import List
import pandas
time_reg = re.compile("Checkpoint \d: ([\d\\.]{1,})")
def run_cmd(cmd):
print(f"Running {cmd}")
proc = subprocess.run(cmd, shell=True, capture_output=True)
stdout = proc.std... | 31.026316 | 83 | 0.563189 | import sys
import os
import subprocess
import re
import time
from dataclasses import dataclass
from typing import List
import pandas
time_reg = re.compile("Checkpoint \d: ([\d\\.]{1,})")
def run_cmd(cmd):
print(f"Running {cmd}")
proc = subprocess.run(cmd, shell=True, capture_output=True)
stdout = proc.std... | true | true |
f726d81ab8d4dbd5bfa8f4889d90ea24f3a749f0 | 6,230 | py | Python | ckanext/reclineview/tests/test_view.py | florianm/ckan | 1cfd98d591ac70b4eb81048bcd227b6c1354b1bf | [
"Apache-2.0"
] | 2 | 2015-07-17T19:09:52.000Z | 2017-08-30T20:23:44.000Z | ckanext/reclineview/tests/test_view.py | florianm/ckan | 1cfd98d591ac70b4eb81048bcd227b6c1354b1bf | [
"Apache-2.0"
] | 12 | 2015-01-19T18:03:56.000Z | 2016-04-11T16:40:33.000Z | ckanext/reclineview/tests/test_view.py | florianm/ckan | 1cfd98d591ac70b4eb81048bcd227b6c1354b1bf | [
"Apache-2.0"
] | 3 | 2015-03-31T06:19:42.000Z | 2016-06-27T15:32:28.000Z | import paste.fixture
import pylons.config as config
import ckan.model as model
import ckan.tests.legacy as tests
import ckan.plugins as p
import ckan.lib.helpers as h
import ckanext.reclineview.plugin as plugin
import ckan.lib.create_test_data as create_test_data
import ckan.config.middleware as middleware
from ckan.... | 34.804469 | 78 | 0.643499 | import paste.fixture
import pylons.config as config
import ckan.model as model
import ckan.tests.legacy as tests
import ckan.plugins as p
import ckan.lib.helpers as h
import ckanext.reclineview.plugin as plugin
import ckan.lib.create_test_data as create_test_data
import ckan.config.middleware as middleware
from ckan.... | true | true |
f726d92eda80cb6386391bf319320971dd446ebc | 3,824 | py | Python | Algorithmic Methods of Data Mining/Final_project/graph_partitioning1.py | JayWu7/Machine-Learning-Courses-Study-Record | 7586c3429514bc21c7cfe42f85ca8c0fcf8f072b | [
"Apache-2.0"
] | 1 | 2019-12-04T12:03:11.000Z | 2019-12-04T12:03:11.000Z | Algorithmic Methods of Data Mining/Final_project/graph_partitioning1.py | JayWu7/Machine-Learning-Courses-Study-Record | 7586c3429514bc21c7cfe42f85ca8c0fcf8f072b | [
"Apache-2.0"
] | null | null | null | Algorithmic Methods of Data Mining/Final_project/graph_partitioning1.py | JayWu7/Machine-Learning-Courses-Study-Record | 7586c3429514bc21c7cfe42f85ca8c0fcf8f072b | [
"Apache-2.0"
] | 1 | 2019-11-18T11:20:58.000Z | 2019-11-18T11:20:58.000Z | import numpy as np
from sklearn.cluster import KMeans
import time
from scipy.sparse.linalg import eigs
from scipy.sparse import csr_matrix
class Graph:
def __init__(self, data_name):
self.filename = data_name
self.n = None
self.k = None
self.edges = self.form_graph()
# sel... | 30.110236 | 94 | 0.537918 | import numpy as np
from sklearn.cluster import KMeans
import time
from scipy.sparse.linalg import eigs
from scipy.sparse import csr_matrix
class Graph:
def __init__(self, data_name):
self.filename = data_name
self.n = None
self.k = None
self.edges = self.form_graph()
= No... | true | true |
f726d9f05387af7ecf63d8618efca4e9f2591141 | 1,539 | py | Python | python/test/crawl_stocks/crawlstocks/spiders/GuchengBlockCodes.py | qrsforever/workspace | 53c7ce7ca7da62c9fbb3d991ae9e4e34d07ece5f | [
"MIT"
] | 2 | 2017-06-07T03:20:42.000Z | 2020-01-07T09:14:26.000Z | python/test/crawl_stocks/crawlstocks/spiders/GuchengBlockCodes.py | qrsforever/workspace | 53c7ce7ca7da62c9fbb3d991ae9e4e34d07ece5f | [
"MIT"
] | null | null | null | python/test/crawl_stocks/crawlstocks/spiders/GuchengBlockCodes.py | qrsforever/workspace | 53c7ce7ca7da62c9fbb3d991ae9e4e34d07ece5f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import re
import scrapy
from crawlstocks.items import GuchengStockCodeItem
class GuchengblockcodesSpider(scrapy.Spider):
name = 'GuchengBlockCodes'
allowed_domains = ['hq.gucheng.com']
custom_settings = {
'ITEM_PIPELINES' : {'crawlstocks.pipelines.file.GuchengCrawlList... | 38.475 | 100 | 0.578298 |
import re
import scrapy
from crawlstocks.items import GuchengStockCodeItem
class GuchengblockcodesSpider(scrapy.Spider):
name = 'GuchengBlockCodes'
allowed_domains = ['hq.gucheng.com']
custom_settings = {
'ITEM_PIPELINES' : {'crawlstocks.pipelines.file.GuchengCrawlListPipeline':200}
... | true | true |
f726da1790877622a36dac64245198de83414f60 | 2,545 | py | Python | bigml/tests/create_projection_steps.py | devs-cloud/python_ml | 05d90f5ce1862a5d2d8ff99d2e46446dc1d5af3c | [
"Apache-2.0"
] | null | null | null | bigml/tests/create_projection_steps.py | devs-cloud/python_ml | 05d90f5ce1862a5d2d8ff99d2e46446dc1d5af3c | [
"Apache-2.0"
] | null | null | null | bigml/tests/create_projection_steps.py | devs-cloud/python_ml | 05d90f5ce1862a5d2d8ff99d2e46446dc1d5af3c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2018-2020 BigML
#
# 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 requi... | 35.84507 | 77 | 0.703733 |
import json
import time
from nose.tools import assert_almost_equals, eq_, assert_is_not_none
from datetime import datetime, timedelta
from world import world
from bigml.api import HTTP_CREATED
from bigml.api import FINISHED, FAULTY
from bigml.api import get_status
from read_projection_steps import i_g... | true | true |
f726da9544773e11f11ee7b9f04bc69fd7f46c4b | 8,615 | py | Python | EOD_api/test_EOD_api.py | webclinic017/time-series-pipeline | 5ac418b91e395a48cba397f95d25d221adfff9bd | [
"MIT"
] | 3 | 2021-08-28T10:55:12.000Z | 2021-12-01T20:42:38.000Z | EOD_api/test_EOD_api.py | webclinic017/time-series-pipeline | 5ac418b91e395a48cba397f95d25d221adfff9bd | [
"MIT"
] | null | null | null | EOD_api/test_EOD_api.py | webclinic017/time-series-pipeline | 5ac418b91e395a48cba397f95d25d221adfff9bd | [
"MIT"
] | 1 | 2021-09-26T16:07:24.000Z | 2021-09-26T16:07:24.000Z | import os
import re
import datetime
import unittest
from io import StringIO
from unittest.mock import patch
import pandas as pd
import EOD_api as eod
TOKEN = os.environ["EOD_TOKEN"]
def date_parser(string):
date_pattern = re.compile("([0-9]{4}-[0-9]{2}-[0-9]{2})[ ]", re.VERBOSE)
return date_pattern.sub(r"\... | 43.075 | 165 | 0.51863 | import os
import re
import datetime
import unittest
from io import StringIO
from unittest.mock import patch
import pandas as pd
import EOD_api as eod
TOKEN = os.environ["EOD_TOKEN"]
def date_parser(string):
date_pattern = re.compile("([0-9]{4}-[0-9]{2}-[0-9]{2})[ ]", re.VERBOSE)
return date_pattern.sub(r"\... | true | true |
f726daae43a8790a611a80a7e3876da1fd12b7ee | 2,804 | py | Python | var/spack/repos/builtin/packages/r-pmcmrplus/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/r-pmcmrplus/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/r-pmcmrplus/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RPmcmrplus(RPackage):
"""Calculate Pairwise Multiple Comparisons of Mean Rank Sums Extende... | 53.923077 | 95 | 0.722183 |
from spack import *
class RPmcmrplus(RPackage):
cran = "PMCMRplus"
version('1.9.3', sha256='76baba60f57343fa5bb6f6d2ea27aab77178e02b0d2f9d5d74abde7d18994f03')
depends_on('r@3.5.0:', type=('build', 'run'))
depends_on('r-mvtnorm@1.0:', type=('build', 'run'))
depends_on('r-multcompview', type... | true | true |
f726dce4683e7d5956b6554b0e5f04d2913f0e26 | 4,225 | py | Python | session4/e_animations_2axis.py | Leylasaadi/MACT20.21_Digital_tools_Big_Data_part_2 | 94cafa0581ec36a305867ebfdcb91c787aa77a16 | [
"Apache-2.0"
] | null | null | null | session4/e_animations_2axis.py | Leylasaadi/MACT20.21_Digital_tools_Big_Data_part_2 | 94cafa0581ec36a305867ebfdcb91c787aa77a16 | [
"Apache-2.0"
] | null | null | null | session4/e_animations_2axis.py | Leylasaadi/MACT20.21_Digital_tools_Big_Data_part_2 | 94cafa0581ec36a305867ebfdcb91c787aa77a16 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
##################################################
# This script shows how to create animated plots using matplotlib and a basic dataset
# Multiple tutorials inspired the current design but they mostly came from:
# hhttps://towardsdatascience.com/how-to-create-animated-graphs-in-python-bb619cc2dec1
#... | 46.428571 | 169 | 0.725444 | true | true | |
f726ddf1c1dac0d3d3a8df65efc42e4d30590ce6 | 9,073 | py | Python | mars/lib/nvutils.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 2,413 | 2018-12-06T09:37:11.000Z | 2022-03-30T15:47:39.000Z | mars/lib/nvutils.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 1,335 | 2018-12-07T03:06:18.000Z | 2022-03-31T11:45:57.000Z | mars/lib/nvutils.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 329 | 2018-12-07T03:12:41.000Z | 2022-03-29T21:49:57.000Z | # -*- coding: utf-8 -*-
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 27.831288 | 109 | 0.689518 |
import logging
import os
import sys
import uuid
from collections import namedtuple
from ctypes import c_char, c_char_p, c_int, c_uint, c_ulonglong, byref,\
create_string_buffer, Structure, POINTER, CDLL
logger = logging.getLogger(__name__)
CUDA_SUCCESS = 0
CU_DEVICE_ATTRIBUTE_MULTIPROCESSOR_COUNT ... | true | true |
f726de42bea9102ed23d3fe9ef9fa07cf1e1fe0c | 595 | py | Python | dbaas/account/admin/__init__.py | didindinn/database-as-a-service | 747de31ff8546f7874ddd654af860e130afd17a0 | [
"BSD-3-Clause"
] | null | null | null | dbaas/account/admin/__init__.py | didindinn/database-as-a-service | 747de31ff8546f7874ddd654af860e130afd17a0 | [
"BSD-3-Clause"
] | null | null | null | dbaas/account/admin/__init__.py | didindinn/database-as-a-service | 747de31ff8546f7874ddd654af860e130afd17a0 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.contrib import admin
from django.contrib.auth.models import User, Group
from ..models import Team, Role, AccountUser, Organization
from .user import CustomUserAdmin
from .role import RoleAdmin
from .team import TeamAdmin
from... | 31.315789 | 58 | 0.820168 |
from __future__ import absolute_import, unicode_literals
from django.contrib import admin
from django.contrib.auth.models import User, Group
from ..models import Team, Role, AccountUser, Organization
from .user import CustomUserAdmin
from .role import RoleAdmin
from .team import TeamAdmin
from .organization import O... | true | true |
f726dea29d24103ee493a83474a24f027af1befb | 11,256 | py | Python | theano/gof/tests/test_destroyhandler.py | mdda/Theano | 6ca7b2b65000e371f009b617d41bc5a90f022d38 | [
"BSD-3-Clause"
] | null | null | null | theano/gof/tests/test_destroyhandler.py | mdda/Theano | 6ca7b2b65000e371f009b617d41bc5a90f022d38 | [
"BSD-3-Clause"
] | null | null | null | theano/gof/tests/test_destroyhandler.py | mdda/Theano | 6ca7b2b65000e371f009b617d41bc5a90f022d38 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
from six.moves import xrange
from theano.gof.type import Type
from theano.gof import graph
from theano.gof.graph import Variable, Apply
from theano.gof.op import Op
from theano.gof.opt import * # noqa
from theano.gof import destroyhandler
from theano.gof.fg import FunctionGraph,... | 25.875862 | 87 | 0.613184 | from __future__ import print_function
from six.moves import xrange
from theano.gof.type import Type
from theano.gof import graph
from theano.gof.graph import Variable, Apply
from theano.gof.op import Op
from theano.gof.opt import *
from theano.gof import destroyhandler
from theano.gof.fg import FunctionGraph, Incon... | true | true |
f726ded0f21d12ce2859ff426b0a1110e948ea9e | 3,510 | py | Python | inlp/tag/ltp.py | IgowWang/IgorNLP | 3d1bd119bed19f386f30ca1ad4bad98f4200661a | [
"Apache-2.0"
] | 2 | 2016-02-26T09:13:58.000Z | 2017-01-28T13:15:19.000Z | inlp/tag/ltp.py | IgowWang/IgorNLP | 3d1bd119bed19f386f30ca1ad4bad98f4200661a | [
"Apache-2.0"
] | null | null | null | inlp/tag/ltp.py | IgowWang/IgorNLP | 3d1bd119bed19f386f30ca1ad4bad98f4200661a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# IgorNLP:ltp 词性标注模块
#
# Author: Igor
import os
import tempfile
from subprocess import PIPE
from nltk.internals import overridden, compat
from inlp.tag.api import TaggerI
from inlp.utils import ltp_cmd
class LtpPosTagger(TaggerI):
'''
ltp 词性标注模块
#test:
sentences = [['这', '是... | 30.258621 | 126 | 0.582906 |
import os
import tempfile
from subprocess import PIPE
from nltk.internals import overridden, compat
from inlp.tag.api import TaggerI
from inlp.utils import ltp_cmd
class LtpPosTagger(TaggerI):
def __init__(self, path_to_ltp, path_to_model=None, path_to_lexicon=None, threads=1,
encoding='u... | true | true |
f726df462e44abc76e9c11946685af130da6d59c | 96 | py | Python | boa3_test/test_sc/relational_test/BoolEquality.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 25 | 2020-07-22T19:37:43.000Z | 2022-03-08T03:23:55.000Z | boa3_test/test_sc/relational_test/BoolEquality.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 419 | 2020-04-23T17:48:14.000Z | 2022-03-31T13:17:45.000Z | boa3_test/test_sc/relational_test/BoolEquality.py | hal0x2328/neo3-boa | 6825a3533384cb01660773050719402a9703065b | [
"Apache-2.0"
] | 15 | 2020-05-21T21:54:24.000Z | 2021-11-18T06:17:24.000Z | from boa3.builtin import public
@public
def Main(a: bool, b: bool) -> bool:
return a == b
| 13.714286 | 35 | 0.645833 | from boa3.builtin import public
@public
def Main(a: bool, b: bool) -> bool:
return a == b
| true | true |
f726e11a06f3a64832e31beeb29cda0f35f7559f | 12,310 | py | Python | tasks.py | nautobot/nautobot-plugin-chatops-aci | d5e92cbaa261e4fbcb175131d03fc6f4e63bc241 | [
"Apache-2.0"
] | null | null | null | tasks.py | nautobot/nautobot-plugin-chatops-aci | d5e92cbaa261e4fbcb175131d03fc6f4e63bc241 | [
"Apache-2.0"
] | 4 | 2021-12-01T19:20:21.000Z | 2022-02-24T22:05:18.000Z | tasks.py | nautobot/nautobot-plugin-chatops-aci | d5e92cbaa261e4fbcb175131d03fc6f4e63bc241 | [
"Apache-2.0"
] | 1 | 2022-01-06T16:37:34.000Z | 2022-01-06T16:37:34.000Z | """Tasks for use with Invoke.
(c) 2020-2021 Network To Code
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 t... | 31.564103 | 177 | 0.646304 |
from distutils.util import strtobool
from invoke import Collection, task as invoke_task
import os
def is_truthy(arg):
if isinstance(arg, bool):
return arg
return bool(strtobool(arg))
namespace = Collection("nautobot_plugin_chatops_aci")
namespace.configure(
{
"nautobot_plugin_chatops_... | true | true |
f726e32c037672a3a1015b66f43061d44ada00cc | 1,226 | py | Python | tryalgo/dist_grid.py | Shloub/tryalgo | ec01a16dd6a6053047f1948531bd5e9b2abf0fab | [
"MIT"
] | null | null | null | tryalgo/dist_grid.py | Shloub/tryalgo | ec01a16dd6a6053047f1948531bd5e9b2abf0fab | [
"MIT"
] | null | null | null | tryalgo/dist_grid.py | Shloub/tryalgo | ec01a16dd6a6053047f1948531bd5e9b2abf0fab | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Distances in a grid
# jill-jenn vie et christoph durr - 2014-2015
from collections import deque
# snip{
def dist_grid(grid, source, target=None):
"""Distances in a grid by BFS
:param grid: matrix with 4-neighborhood
:param (int,int) source: pair of row, c... | 30.65 | 69 | 0.513866 |
from collections import deque
def dist_grid(grid, source, target=None):
rows = len(grid)
cols = len(grid[0])
dir = [(0, +1, '>'), (0, -1, '<'), (+1, 0, 'v'), (-1, 0, '^')]
i, j = source
grid[i][j] = 's'
Q = deque()
Q.append(source)
while Q:
i1, j1 = Q.popleft()
fo... | true | true |
f726e3fffed7bf64ee84e30593164304e7fa5261 | 83,112 | py | Python | genepattern/utils/clustering.py | genepattern/genepattern-utils | 950d748301b3c4d07ad8d24c9b037bbb9b4c80e2 | [
"BSD-3-Clause"
] | null | null | null | genepattern/utils/clustering.py | genepattern/genepattern-utils | 950d748301b3c4d07ad8d24c9b037bbb9b4c80e2 | [
"BSD-3-Clause"
] | null | null | null | genepattern/utils/clustering.py | genepattern/genepattern-utils | 950d748301b3c4d07ad8d24c9b037bbb9b4c80e2 | [
"BSD-3-Clause"
] | null | null | null | """
Copied and modified from the dev branch of:
https://github.com/genepattern/HierarchicalClustering
on 2018-01-31
"""
import sys
import numpy as np
from statistics import mode
from sklearn.metrics import pairwise
from sklearn import metrics
from scipy.cluster.hierarchy import dendrogram
import matplotlib.pyplot as p... | 41.66015 | 132 | 0.623869 | import sys
import numpy as np
from statistics import mode
from sklearn.metrics import pairwise
from sklearn import metrics
from scipy.cluster.hierarchy import dendrogram
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import itertools
from sklearn.cluster import AgglomerativeClustering
import... | true | true |
f726e468fffed12d4ce9bb88c0a2c8505212f61d | 6,650 | py | Python | visualizer/visualizer/network.py | NikKaem/mapf-project | d99727d5f62380cf2a7d37dec70b5cdc71db3fb6 | [
"MIT"
] | null | null | null | visualizer/visualizer/network.py | NikKaem/mapf-project | d99727d5f62380cf2a7d37dec70b5cdc71db3fb6 | [
"MIT"
] | null | null | null | visualizer/visualizer/network.py | NikKaem/mapf-project | d99727d5f62380cf2a7d37dec70b5cdc71db3fb6 | [
"MIT"
] | null | null | null | from threading import Thread
import socket
import select
import time
import os
import clingo
import argparse
from PyQt5.QtCore import *
class VisualizerSocket(object):
def __init__(self, default_host = '127.0.0.1', default_port = 5000, socket_name = 'socket'):
self._host = default_host
se... | 29.424779 | 96 | 0.530226 | from threading import Thread
import socket
import select
import time
import os
import clingo
import argparse
from PyQt5.QtCore import *
class VisualizerSocket(object):
def __init__(self, default_host = '127.0.0.1', default_port = 5000, socket_name = 'socket'):
self._host = default_host
se... | true | true |
f726e4b41f15fdd676d9d580ff8e3144b72f2f13 | 4,712 | py | Python | taxumap-manuscript-notebooks/embeddings.py | jsevo/taxumap | 1a02518dca822a65847994910177c74607243dae | [
"MIT"
] | 5 | 2021-11-21T16:47:17.000Z | 2022-02-04T16:57:15.000Z | taxumap-manuscript-notebooks/embeddings.py | jsevo/taxumap | 1a02518dca822a65847994910177c74607243dae | [
"MIT"
] | 13 | 2021-03-31T19:08:10.000Z | 2022-02-15T19:57:18.000Z | taxumap-manuscript-notebooks/embeddings.py | jsevo/taxumap | 1a02518dca822a65847994910177c74607243dae | [
"MIT"
] | 3 | 2021-09-22T19:21:36.000Z | 2022-02-10T21:39:35.000Z | from sklearn.manifold import TSNE
from sklearn.decomposition import PCA, KernelPCA
from umap import UMAP
from sklearn.preprocessing import MinMaxScaler
RUNEMBEDDINGS = False
if RUNEMBEDDINGS:
#simple PCA
pcaembedding = PCA(n_components=2).fit_transform(XASV.fillna(0))
#base embedding (kernel pca)
... | 40.62069 | 150 | 0.574278 | from sklearn.manifold import TSNE
from sklearn.decomposition import PCA, KernelPCA
from umap import UMAP
from sklearn.preprocessing import MinMaxScaler
RUNEMBEDDINGS = False
if RUNEMBEDDINGS:
pcaembedding = PCA(n_components=2).fit_transform(XASV.fillna(0))
kernelpcaembedding = KernelPCA(n_compo... | true | true |
f726e62af700d6cd869103c9f957465198c2bb6d | 218 | py | Python | structurizr/model/enterprise.py | sixty-north/structurizr-python | 856d0476935952c256981f3628663915768ee85e | [
"Apache-2.0"
] | 15 | 2017-07-20T20:43:40.000Z | 2021-11-12T11:25:01.000Z | structurizr/model/enterprise.py | sixty-north/structurizr-python | 856d0476935952c256981f3628663915768ee85e | [
"Apache-2.0"
] | 2 | 2017-06-05T17:41:05.000Z | 2018-09-11T08:18:07.000Z | structurizr/model/enterprise.py | sixty-north/structurizr-python | 856d0476935952c256981f3628663915768ee85e | [
"Apache-2.0"
] | 7 | 2017-08-16T19:51:24.000Z | 2020-09-24T09:47:35.000Z | class Enterprise:
def __init__(self, name):
if len(name.strip()) == 0:
raise ValueError("Name must be specified.")
self._name = name
def get_name(self):
return self._name
| 19.818182 | 55 | 0.577982 | class Enterprise:
def __init__(self, name):
if len(name.strip()) == 0:
raise ValueError("Name must be specified.")
self._name = name
def get_name(self):
return self._name
| true | true |
f726e62b1de4faf4969737dc866dadf797d1e5a6 | 3,616 | py | Python | reminder/admin/forms.py | luk-kop/event-reminder-apscheduler | 405c9731d340d111aac83094a93b06ec60256754 | [
"MIT"
] | 1 | 2021-04-02T11:07:12.000Z | 2021-04-02T11:07:12.000Z | reminder/admin/forms.py | luk-kop/event-reminder-apscheduler | 405c9731d340d111aac83094a93b06ec60256754 | [
"MIT"
] | 2 | 2021-03-20T22:04:50.000Z | 2021-06-09T07:02:36.000Z | reminder/admin/forms.py | luk-kop/event-reminder | 405c9731d340d111aac83094a93b06ec60256754 | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SelectField, IntegerField
from wtforms.validators import InputRequired, EqualTo, Regexp, Length, NumberRange, Optional, Email
from reminder.custom_wtforms import MxRecordValidator
class NewUserForm(FlaskForm):
"""
Validators for ... | 56.5 | 118 | 0.518252 | from flask_wtf import FlaskForm
from wtforms import StringField, PasswordField, SelectField, IntegerField
from wtforms.validators import InputRequired, EqualTo, Regexp, Length, NumberRange, Optional, Email
from reminder.custom_wtforms import MxRecordValidator
class NewUserForm(FlaskForm):
username = StringField(... | true | true |
f726e725cce6a2546e0dca558dcc54f0ee808e67 | 954 | py | Python | apps/node/src/app/main/users/role.py | AmrMKayid/PyGrid | 695a041649f7cfab6acc7d1495e2a6132f65d529 | [
"Apache-2.0"
] | 7 | 2020-04-20T22:22:08.000Z | 2020-07-25T17:32:08.000Z | apps/node/src/app/main/users/role.py | AmrMKayid/PyGrid | 695a041649f7cfab6acc7d1495e2a6132f65d529 | [
"Apache-2.0"
] | 3 | 2020-04-24T21:20:57.000Z | 2020-05-28T09:17:02.000Z | apps/node/src/app/main/users/role.py | AmrMKayid/PyGrid | 695a041649f7cfab6acc7d1495e2a6132f65d529 | [
"Apache-2.0"
] | 4 | 2020-04-24T22:32:37.000Z | 2020-05-25T19:29:20.000Z | from ... import BaseModel, db
class Role(BaseModel):
__tablename__ = "role"
id = db.Column(db.Integer(), primary_key=True, autoincrement=True)
name = db.Column(db.String())
can_triage_jobs = db.Column(db.Boolean())
can_edit_settings = db.Column(db.Boolean())
can_create_users = db.Column(db.Bo... | 36.692308 | 75 | 0.645702 | from ... import BaseModel, db
class Role(BaseModel):
__tablename__ = "role"
id = db.Column(db.Integer(), primary_key=True, autoincrement=True)
name = db.Column(db.String())
can_triage_jobs = db.Column(db.Boolean())
can_edit_settings = db.Column(db.Boolean())
can_create_users = db.Column(db.Bo... | true | true |
f726e78d6350d5f990597a123318cd9d4a4c9fb9 | 2,497 | py | Python | axol_node/plugins/resources/resource_get_all_roles.py | kelceydamage/axol | b5288577ee769bcd609c361cb0ac5e2a678289da | [
"Apache-2.0"
] | null | null | null | axol_node/plugins/resources/resource_get_all_roles.py | kelceydamage/axol | b5288577ee769bcd609c361cb0ac5e2a678289da | [
"Apache-2.0"
] | null | null | null | axol_node/plugins/resources/resource_get_all_roles.py | kelceydamage/axol | b5288577ee769bcd609c361cb0ac5e2a678289da | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
#-----------------------------------------#
#Copyright [2015] [Kelcey Jamison-Damage]
#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/li... | 32.855263 | 84 | 0.682819 |
rom axol_common.classes.common_logger import CommonLogger
from axol_common.classes.common_data_object import GenericDataObject
from axol_common.classes.common_resource import CommonResource
from axol_common.distributed.axol_roledefs import generate_base_roles
from classes.axol_resource import Axo... | false | true |
f726e80aacceea27942a112dde7b312235a8f554 | 35,185 | py | Python | sdks/python/apache_beam/typehints/decorators.py | VrishaliShah/beam | c27f5f724e38fbec829d9cf8920fac2bdedb7ca4 | [
"Apache-2.0"
] | null | null | null | sdks/python/apache_beam/typehints/decorators.py | VrishaliShah/beam | c27f5f724e38fbec829d9cf8920fac2bdedb7ca4 | [
"Apache-2.0"
] | 2 | 2021-08-25T16:17:07.000Z | 2022-02-10T04:23:10.000Z | sdks/python/apache_beam/typehints/decorators.py | VrishaliShah/beam | c27f5f724e38fbec829d9cf8920fac2bdedb7ca4 | [
"Apache-2.0"
] | 1 | 2020-01-16T17:00:26.000Z | 2020-01-16T17:00:26.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 us... | 34.562868 | 109 | 0.699986 |
from __future__ import absolute_import
import inspect
import itertools
import logging
import sys
import traceback
import types
from builtins import next
from builtins import object
from builtins import zip
from typing import Any
from typing import Callable
from typing import Dict
from typing import... | true | true |
f726e812891f79ad91797716634694dc86a45c44 | 4,022 | py | Python | h/services/group.py | julien-cheng/h | 36c8ec044725720cf36f0986cdf025395aca8929 | [
"BSD-2-Clause"
] | 2 | 2019-08-04T07:22:11.000Z | 2020-07-17T05:01:41.000Z | h/services/group.py | 11-eleven-11/h | 91c7a4504ad7471ed3e30246763a03e6c1cc531b | [
"BSD-2-Clause"
] | null | null | null | h/services/group.py | 11-eleven-11/h | 91c7a4504ad7471ed3e30246763a03e6c1cc531b | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sqlalchemy as sa
from h.models import Group, User
from h.models.group import ReadableBy
from h.util import group as group_util
class GroupService(object):
def __init__(self, session, user_fetcher):
"""
Create a new groups se... | 31.920635 | 87 | 0.60915 |
from __future__ import unicode_literals
import sqlalchemy as sa
from h.models import Group, User
from h.models.group import ReadableBy
from h.util import group as group_util
class GroupService(object):
def __init__(self, session, user_fetcher):
self.session = session
self.user_fetcher = user_f... | true | true |
f726e91e889b74acf6f116c6d95887b343147e4d | 73,451 | py | Python | tools/sourcecode/Python-3.10.0/Lib/asyncio/base_events.py | gagominecraft12/Blueity-Client-Retrace | d42a927a85226d73da66123922d9ea11cc20ac3d | [
"MIT"
] | 33 | 2021-07-25T14:23:35.000Z | 2022-03-31T00:17:30.000Z | tools/sourcecode/Python-3.10.0/Lib/asyncio/base_events.py | gagominecraft12/Blueity-Client-Retrace | d42a927a85226d73da66123922d9ea11cc20ac3d | [
"MIT"
] | 32 | 2019-04-26T12:29:36.000Z | 2022-03-08T14:24:30.000Z | Lib/asyncio/base_events.py | val-verde/cpython | 17aa701d799d5e071d83205d877f722f1498a09f | [
"0BSD"
] | 3 | 2019-11-12T15:21:58.000Z | 2020-09-04T14:27:55.000Z | """Base implementation of event loop.
The event loop can be broken up into a multiplexer (the part
responsible for notifying us of I/O events) and the event loop proper,
which wraps a multiplexer with functionality for scheduling callbacks,
immediately or at a given time in the future.
Whenever a public API takes a c... | 38.516518 | 83 | 0.573689 |
import collections
import collections.abc
import concurrent.futures
import functools
import heapq
import itertools
import os
import socket
import stat
import subprocess
import threading
import time
import traceback
import sys
import warnings
import weakref
try:
import ssl
except ImportError:
ssl = None
fro... | true | true |
f726e9f4ca4961a8ea29f9196c6fa380bedb6b8e | 1,865 | py | Python | test/unittest/committee_test.py | Cocos-BCX/Python-Middleware | 9e8db14cdbf12131964d48d1189e0686b69369a8 | [
"MIT"
] | 101 | 2019-07-24T08:30:30.000Z | 2021-02-18T15:11:59.000Z | test/unittest/committee_test.py | marcomgsilva/Python-Middleware | 9e8db14cdbf12131964d48d1189e0686b69369a8 | [
"MIT"
] | 4 | 2019-08-01T10:06:29.000Z | 2019-11-29T08:32:34.000Z | test/unittest/committee_test.py | marcomgsilva/Python-Middleware | 9e8db14cdbf12131964d48d1189e0686b69369a8 | [
"MIT"
] | 7 | 2019-08-11T16:02:41.000Z | 2021-02-11T04:23:51.000Z | import unittest
from config import Config
class CommitteeTestCase(unittest.TestCase):
def testCreateCommittee(self):
params = {
"url": " ",
"account": "1.2.25"
}
gph = Config().gph
try:
print("CreateCommittee:", gph.committee_member_create(**par... | 27.835821 | 77 | 0.527614 | import unittest
from config import Config
class CommitteeTestCase(unittest.TestCase):
def testCreateCommittee(self):
params = {
"url": " ",
"account": "1.2.25"
}
gph = Config().gph
try:
print("CreateCommittee:", gph.committee_member_create(**par... | true | true |
f726eaa4291a25a6faf61571bc3ad1b43a3541f2 | 4,011 | py | Python | PhysicsTools/Heppy/python/physicsutils/genutils.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | PhysicsTools/Heppy/python/physicsutils/genutils.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | PhysicsTools/Heppy/python/physicsutils/genutils.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | from PhysicsTools.Heppy.physicsobjects.PhysicsObjects import printOut
from PhysicsTools.Heppy.physicsobjects.PhysicsObjects import GenParticle
def findStatus1Leptons(particle):
'''Returns status 1 e and mu among the particle daughters'''
leptons = []
for i in range( particle.numberOfDaughters() ):
... | 33.705882 | 86 | 0.605834 | from PhysicsTools.Heppy.physicsobjects.PhysicsObjects import printOut
from PhysicsTools.Heppy.physicsobjects.PhysicsObjects import GenParticle
def findStatus1Leptons(particle):
leptons = []
for i in range( particle.numberOfDaughters() ):
dau = particle.daughter(i)
if dau.status() == 1:
... | true | true |
f726ebf3b8c2775c6822150273cdcd7cd4ffc96d | 2,878 | py | Python | factor_tools.py | ericgreveson/projecteuler | 1844bf383fca871b82d88ef1eb3a9b1a0e363054 | [
"Apache-2.0"
] | null | null | null | factor_tools.py | ericgreveson/projecteuler | 1844bf383fca871b82d88ef1eb3a9b1a0e363054 | [
"Apache-2.0"
] | null | null | null | factor_tools.py | ericgreveson/projecteuler | 1844bf383fca871b82d88ef1eb3a9b1a0e363054 | [
"Apache-2.0"
] | null | null | null | from fractions import Fraction
import math
def compute_factors(n):
"""
Return a list of all factors (proper divisors) of a number n, including the factor 1
"""
factors = [1]
for i in range(2, int(math.sqrt(n)) + 1):
if n % i == 0:
factors.append(i)
factors.append(n /... | 25.927928 | 95 | 0.59729 | from fractions import Fraction
import math
def compute_factors(n):
factors = [1]
for i in range(2, int(math.sqrt(n)) + 1):
if n % i == 0:
factors.append(i)
factors.append(n // i)
return factors
def is_prime(n, prime_cache=None, prime_cache_max=None):
if n in [2, 3... | true | true |
f726ebfcc0be524ce8e65eb0ea66ac8411693e2e | 1,175 | py | Python | course_grader/dao/__init__.py | uw-it-aca/gradepage | 7059d715cc112ad0ecb0e5012f716e525ee7b3bc | [
"Apache-2.0"
] | 1 | 2017-01-29T09:52:06.000Z | 2017-01-29T09:52:06.000Z | course_grader/dao/__init__.py | uw-it-aca/gradepage | 7059d715cc112ad0ecb0e5012f716e525ee7b3bc | [
"Apache-2.0"
] | 287 | 2017-03-09T00:17:20.000Z | 2022-01-08T00:36:34.000Z | course_grader/dao/__init__.py | uw-it-aca/gradepage | 7059d715cc112ad0ecb0e5012f716e525ee7b3bc | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
from django.conf import settings
from django.utils.timezone import (
get_default_timezone, localtime, is_naive, make_aware)
from datetime import datetime
from uw_sws import SWS_DAO, sws_now
from abc import ABC, abstractmethod
... | 25.543478 | 79 | 0.700426 |
from django.conf import settings
from django.utils.timezone import (
get_default_timezone, localtime, is_naive, make_aware)
from datetime import datetime
from uw_sws import SWS_DAO, sws_now
from abc import ABC, abstractmethod
def __update_get(self, url, response):
pass
SWS_DAO._update_get = __update_get... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.