hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08efa020ae103f6254ea6077e4b5999da6092154 | 1,264 | py | Python | reagent/test/preprocessing/test_type_identification.py | dmitryvinn/ReAgent | f98825b9d021ec353a1f9087840a05fea259bf42 | [
"BSD-3-Clause"
] | null | null | null | reagent/test/preprocessing/test_type_identification.py | dmitryvinn/ReAgent | f98825b9d021ec353a1f9087840a05fea259bf42 | [
"BSD-3-Clause"
] | null | null | null | reagent/test/preprocessing/test_type_identification.py | dmitryvinn/ReAgent | f98825b9d021ec353a1f9087840a05fea259bf42 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import unittest
from reagent.preprocessing import identify_types
from reagent.test.preprocessing.preprocessing_util import (
BINARY_FEATURE_ID,
BOXCOX_FEATURE_ID,
CONTINUOUS_FEATURE_ID,
ENUM_FEATURE_ID,
... | 34.162162 | 83 | 0.738924 |
import unittest
from reagent.preprocessing import identify_types
from reagent.test.preprocessing.preprocessing_util import (
BINARY_FEATURE_ID,
BOXCOX_FEATURE_ID,
CONTINUOUS_FEATURE_ID,
ENUM_FEATURE_ID,
PROBABILITY_FEATURE_ID,
QUANTILE_FEATURE_ID,
read_data,
)
class TestTypeIdentificatio... | true | true |
08efa08c1750ebd2a88f958ec8ebc2e4bc48cd0d | 1,542 | py | Python | snakemake/configs/mm10_SRP011987.py | saketkc/re-ribo-smk | c9326cbafdfa060e22e9af692d9146c37f5035ba | [
"BSD-2-Clause"
] | 1 | 2019-09-11T17:09:48.000Z | 2019-09-11T17:09:48.000Z | snakemake/configs/mm10_SRP011987.py | saketkc/re-ribo-smk | c9326cbafdfa060e22e9af692d9146c37f5035ba | [
"BSD-2-Clause"
] | null | null | null | snakemake/configs/mm10_SRP011987.py | saketkc/re-ribo-smk | c9326cbafdfa060e22e9af692d9146c37f5035ba | [
"BSD-2-Clause"
] | null | null | null | RAWDATA_DIR = '/staging/as/skchoudh/re-ribo-datasets/mm10/SRP011987'
OUT_DIR = '/staging/as/skchoudh/re-ribo-analysis/mm10/SRP011987'
GENOME_FASTA = '/home/cmb-06/as/skchoudh/genomes/mm10/fasta/Mus_musculus.GRCm38.dna.primary_assembly.fa'
CHROM_SIZES = '/home/cmb-06/as/skchoudh/genomes/mm10/fasta/Mus_musculus.GRCm38.dn... | 81.157895 | 120 | 0.808042 | RAWDATA_DIR = '/staging/as/skchoudh/re-ribo-datasets/mm10/SRP011987'
OUT_DIR = '/staging/as/skchoudh/re-ribo-analysis/mm10/SRP011987'
GENOME_FASTA = '/home/cmb-06/as/skchoudh/genomes/mm10/fasta/Mus_musculus.GRCm38.dna.primary_assembly.fa'
CHROM_SIZES = '/home/cmb-06/as/skchoudh/genomes/mm10/fasta/Mus_musculus.GRCm38.dn... | true | true |
08efa1316a86425049342e490c30ef5010136935 | 2,913 | py | Python | grow/server/main.py | grow/grow | 97fc21730b6a674d5d33948d94968e79447ce433 | [
"MIT"
] | 335 | 2016-04-02T20:12:21.000Z | 2022-03-28T18:55:26.000Z | grow/server/main.py | grow/grow | 97fc21730b6a674d5d33948d94968e79447ce433 | [
"MIT"
] | 784 | 2016-04-01T16:56:41.000Z | 2022-03-05T01:25:34.000Z | grow/server/main.py | grow/grow | 97fc21730b6a674d5d33948d94968e79447ce433 | [
"MIT"
] | 54 | 2016-05-03T13:06:15.000Z | 2021-09-24T04:46:23.000Z | """Grow local development server."""
import os
import pkg_resources
from urllib import parse as url_parse
from werkzeug import serving
from werkzeug.middleware import shared_data
from grow.common import utils
from grow.pods import errors
from grow.sdk import sdk_utils
from grow.server import handlers
# Use grow's lo... | 34.270588 | 77 | 0.653278 |
import os
import pkg_resources
from urllib import parse as url_parse
from werkzeug import serving
from werkzeug.middleware import shared_data
from grow.common import utils
from grow.pods import errors
from grow.sdk import sdk_utils
from grow.server import handlers
class RequestHandler(serving.WSGIRequestHandler):
... | true | true |
08efa33093094e0ee1a49cc1570f1fb0e15a2c3f | 1,575 | py | Python | batch_runs/print_learning_rate.py | HoseungCha/mist-rnns | 523d1fa769a7ed29fce22138d1993a8acca28c41 | [
"Apache-2.0"
] | 54 | 2017-03-21T12:38:36.000Z | 2021-11-10T16:16:30.000Z | batch_runs/print_learning_rate.py | HoseungCha/mist-rnns | 523d1fa769a7ed29fce22138d1993a8acca28c41 | [
"Apache-2.0"
] | 1 | 2018-03-20T09:47:06.000Z | 2018-03-20T13:01:29.000Z | batch_runs/print_learning_rate.py | rdipietro/mist-rnns | 523d1fa769a7ed29fce22138d1993a8acca28c41 | [
"Apache-2.0"
] | 12 | 2017-03-26T23:50:35.000Z | 2020-11-17T08:55:53.000Z | import argparse
import numpy as np
def main():
""" Print a learning rate. """
description = main.__doc__
formatter_class = argparse.ArgumentDefaultsHelpFormatter
parser = argparse.ArgumentParser(description=description, formatter_class=formatter_class)
parser.add_argument('type', type=str, choices=['grid',... | 41.447368 | 107 | 0.644444 | import argparse
import numpy as np
def main():
description = main.__doc__
formatter_class = argparse.ArgumentDefaultsHelpFormatter
parser = argparse.ArgumentParser(description=description, formatter_class=formatter_class)
parser.add_argument('type', type=str, choices=['grid', 'random'],
... | true | true |
08efa358050ed83d573f3cd16e87dfeca6a2daf7 | 2,621 | py | Python | test/scripts/test_process_return_values.py | fujiehuang/ecto | fea744337aa1fad1397c9a3ba5baa143993cb5eb | [
"BSD-3-Clause"
] | null | null | null | test/scripts/test_process_return_values.py | fujiehuang/ecto | fea744337aa1fad1397c9a3ba5baa143993cb5eb | [
"BSD-3-Clause"
] | null | null | null | test/scripts/test_process_return_values.py | fujiehuang/ecto | fea744337aa1fad1397c9a3ba5baa143993cb5eb | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2011, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# n... | 35.418919 | 77 | 0.706219 |
import ecto
import ecto.ecto_test as ecto_test
def makeplasm(N):
plasm = ecto.Plasm()
gen = ecto_test.Generate(start=0, step=1)
quitter = ecto_test.QuitAfter(N=N)
plasm.connect(gen[:] >> quitter[:])
return (gen, plasm)
def do_one_st(N):
print("multithreaded test w/ quit after", N)
(gen,... | true | true |
08efa4d3894d298a4647e9c159af690241f59809 | 4,436 | py | Python | predict.py | madtomy/udacity_image_classifier | e5f6fa54ebe8f405b99905a12c29588e9aaf4d1d | [
"MIT"
] | null | null | null | predict.py | madtomy/udacity_image_classifier | e5f6fa54ebe8f405b99905a12c29588e9aaf4d1d | [
"MIT"
] | null | null | null | predict.py | madtomy/udacity_image_classifier | e5f6fa54ebe8f405b99905a12c29588e9aaf4d1d | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''
usage: python predict.py /path/to/image checkpoint
Options:
- Return most likely classes: python predict.py input checkpoint --top_k 3
- Use a mapping of categories to names: python predict.py input checkpoint --category_names cat_to_name.json
- Use GPU for inference: python predict.py input... | 34.123077 | 113 | 0.626465 |
import argparse
import numpy as np
import torch
from PIL import Image
import json
class Predict_class :
@staticmethod
def process_image(img_path):
img = Image.open(img_path)
width,height = img.size
aspect_ratio = width / height
if aspect_ratio > 1 :
img = img.resiz... | true | true |
08efa8629da08df436eb4af921a005fb9a8875ba | 1,117 | py | Python | dwim/rules/port_already_in_use.py | aoeu/DWIM | a3d59e5824cfd7a5195916c1af28fe54dcbbb2c1 | [
"MIT"
] | null | null | null | dwim/rules/port_already_in_use.py | aoeu/DWIM | a3d59e5824cfd7a5195916c1af28fe54dcbbb2c1 | [
"MIT"
] | null | null | null | dwim/rules/port_already_in_use.py | aoeu/DWIM | a3d59e5824cfd7a5195916c1af28fe54dcbbb2c1 | [
"MIT"
] | null | null | null | import re
from subprocess import Popen, PIPE
from dwim.utils import memoize, which
from dwim.shells import shell
enabled_by_default = bool(which('lsof'))
patterns = [r"bind on address \('.*', (?P<port>\d+)\)",
r'Unable to bind [^ ]*:(?P<port>\d+)',
r"can't listen on port (?P<port>\d+)",
... | 26.595238 | 65 | 0.617726 | import re
from subprocess import Popen, PIPE
from dwim.utils import memoize, which
from dwim.shells import shell
enabled_by_default = bool(which('lsof'))
patterns = [r"bind on address \('.*', (?P<port>\d+)\)",
r'Unable to bind [^ ]*:(?P<port>\d+)',
r"can't listen on port (?P<port>\d+)",
... | true | true |
08efa8947d0175d516a6ec87ffd80d9cef11e667 | 1,012 | py | Python | dephell/commands/docker_create.py | OliverHofkens/dephell | 6303f416018910668f1635b70cd828a2fd2b2d9e | [
"MIT"
] | 1,880 | 2019-03-21T10:08:25.000Z | 2022-03-31T12:41:55.000Z | dephell/commands/docker_create.py | rachmadaniHaryono/dephell | 0ef500c8f2d5f05244bac191b1b1383f68464cd2 | [
"MIT"
] | 356 | 2019-03-21T19:08:56.000Z | 2021-01-08T17:45:43.000Z | dephell/commands/docker_create.py | rachmadaniHaryono/dephell | 0ef500c8f2d5f05244bac191b1b1383f68464cd2 | [
"MIT"
] | 157 | 2019-04-23T01:13:37.000Z | 2022-03-24T22:41:18.000Z | # built-in
from argparse import ArgumentParser
# app
from ..actions import get_docker_container
from ..config import builders
from .base import BaseCommand
class DockerCreateCommand(BaseCommand):
"""Create docker container for current project.
"""
@staticmethod
def build_parser(parser) -> ArgumentPar... | 28.914286 | 73 | 0.662055 | from argparse import ArgumentParser
from ..actions import get_docker_container
from ..config import builders
from .base import BaseCommand
class DockerCreateCommand(BaseCommand):
@staticmethod
def build_parser(parser) -> ArgumentParser:
builders.build_config(parser)
builders.build_docker(pars... | true | true |
08efa8b926baf554d771959bc67d796fa1e43865 | 2,275 | py | Python | testcase/test_case_4_QuickdrawDataset4dict_2nn.py | Team-Squad-Up/multigraph_transformer | 180a4dc172695d305ab8a945698cd24401d42e66 | [
"MIT"
] | 268 | 2019-12-24T05:27:57.000Z | 2022-03-31T13:59:30.000Z | testcase/test_case_4_QuickdrawDataset4dict_2nn.py | Team-Squad-Up/multigraph_transformer | 180a4dc172695d305ab8a945698cd24401d42e66 | [
"MIT"
] | 2 | 2020-08-10T02:57:57.000Z | 2021-01-05T06:19:40.000Z | testcase/test_case_4_QuickdrawDataset4dict_2nn.py | PengBoXiangShang/multigraph_transformer | 04aaf575a5242d44e08910a9583c623f14b61b62 | [
"MIT"
] | 26 | 2019-12-24T13:24:58.000Z | 2022-03-21T08:42:20.000Z | import numpy as np
import ipdb
def produce_adjacent_matrix_2_neighbors(flag_bits, stroke_len):
assert flag_bits.shape == (10, 1)
adja_matr = np.zeros([10, 10], int)
#
adja_matr[ : ][ : ] = -1e10
adja_matr[0][0] = 0
# TODO
if (flag_bits[0] == 100):
adja_matr[0][1] = 0... | 29.934211 | 190 | 0.491868 | import numpy as np
import ipdb
def produce_adjacent_matrix_2_neighbors(flag_bits, stroke_len):
assert flag_bits.shape == (10, 1)
adja_matr = np.zeros([10, 10], int)
adja_matr[ : ][ : ] = -1e10
adja_matr[0][0] = 0
if (flag_bits[0] == 100):
adja_matr[0][1] = 0
fo... | true | true |
08efa8cb4bd858a384e2b3eff48cbfdd43786958 | 11,180 | py | Python | pinnacle/pub_dataviz.py | mlares/iate_audit | 3ae8aff2b3de853d43619c592ac8cedf0ff35591 | [
"MIT"
] | null | null | null | pinnacle/pub_dataviz.py | mlares/iate_audit | 3ae8aff2b3de853d43619c592ac8cedf0ff35591 | [
"MIT"
] | null | null | null | pinnacle/pub_dataviz.py | mlares/iate_audit | 3ae8aff2b3de853d43619c592ac8cedf0ff35591 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# PUB_DATAVIZ: Visualization tools for PINNACLE
# Copyright (c) 2020, Marcelo Lares
#
# MIT License:
# https://github.com/IATE-CONICET-UNC/pinnacle/blob/master/LICENSE
from matplotlib import pyplot as plt
from pinnacle.plot_styles import cycling_attrs, aes_attrs
import ... | 28.232323 | 79 | 0.52737 |
from matplotlib import pyplot as plt
from pinnacle.plot_styles import cycling_attrs, aes_attrs
import numpy as np
import random
class pub_dataviz:
def __init__(self, inst):
self.inst = inst
self.config = inst.config
def papers_histogram(self, top=False, per_auth=False, quality=5):
... | true | true |
08efa9602c311ca708559325a057ec2b1724867d | 1,778 | py | Python | api/views.py | maurxeugenio/athena | cfde704dd495dbfd5678fa913172e4bdb759e5c0 | [
"MIT"
] | 1 | 2017-12-08T23:00:00.000Z | 2017-12-08T23:00:00.000Z | api/views.py | maurxeugenio/athena | cfde704dd495dbfd5678fa913172e4bdb759e5c0 | [
"MIT"
] | null | null | null | api/views.py | maurxeugenio/athena | cfde704dd495dbfd5678fa913172e4bdb759e5c0 | [
"MIT"
] | null | null | null | from django.shortcuts import get_object_or_404
from core.models import Scheduling
from rest_framework import status
from rest_framework.views import APIView
from rest_framework.response import Response
from api.serializer import SchedulingSerializer
class SchedulingListView(APIView):
serializer_class = Schedulin... | 34.862745 | 82 | 0.726097 | from django.shortcuts import get_object_or_404
from core.models import Scheduling
from rest_framework import status
from rest_framework.views import APIView
from rest_framework.response import Response
from api.serializer import SchedulingSerializer
class SchedulingListView(APIView):
serializer_class = Schedulin... | true | true |
08efa9f5d5dfc36a9bbc07ce459882996389d9e4 | 1,735 | py | Python | extraPackages/matplotlib-3.0.3/examples/images_contours_and_fields/interpolation_methods.py | dolboBobo/python3_ios | 877f8c2c5890f26292ddd14909bea62a04fe2889 | [
"BSD-3-Clause"
] | 130 | 2018-02-03T10:25:54.000Z | 2022-03-25T22:27:22.000Z | extraPackages/matplotlib-3.0.2/examples/images_contours_and_fields/interpolation_methods.py | spacetime314/python3_ios | e149f1bc2e50046c8810f83dae7739a8dea939ee | [
"BSD-3-Clause"
] | 9 | 2018-12-14T07:31:42.000Z | 2020-12-09T20:29:28.000Z | extraPackages/matplotlib-3.0.2/examples/images_contours_and_fields/interpolation_methods.py | spacetime314/python3_ios | e149f1bc2e50046c8810f83dae7739a8dea939ee | [
"BSD-3-Clause"
] | 64 | 2018-04-25T08:51:57.000Z | 2022-01-29T14:13:57.000Z | """
=================================
Interpolations for imshow/matshow
=================================
This example displays the difference between interpolation methods for
:meth:`~.axes.Axes.imshow` and :meth:`~.axes.Axes.matshow`.
If `interpolation` is None, it defaults to the ``image.interpolation``
:doc:`rc p... | 30.982143 | 79 | 0.632277 |
import matplotlib.pyplot as plt
import numpy as np
methods = [None, 'none', 'nearest', 'bilinear', 'bicubic', 'spline16',
'spline36', 'hanning', 'hamming', 'hermite', 'kaiser', 'quadric',
'catrom', 'gaussian', 'bessel', 'mitchell', 'sinc', 'lanczos']
np.random.seed(19680801)
grid = np.random.r... | true | true |
08efa9fbc518813d718770c9d312a178f9d48854 | 3,231 | py | Python | tests/test_general_table_methods.py | Hakonmh/featherstore | 2dacdb6645b8ad0a559c6e20b598e3f8858d14e1 | [
"MIT"
] | null | null | null | tests/test_general_table_methods.py | Hakonmh/featherstore | 2dacdb6645b8ad0a559c6e20b598e3f8858d14e1 | [
"MIT"
] | null | null | null | tests/test_general_table_methods.py | Hakonmh/featherstore | 2dacdb6645b8ad0a559c6e20b598e3f8858d14e1 | [
"MIT"
] | null | null | null | import pytest
from .fixtures import *
def test_rename_table(store):
# Arrange
NEW_TABLE_NAME = "new_table_name"
df = make_table()
store.write_table("table_name", df)
store.rename_table("table_name", to=NEW_TABLE_NAME)
table = store.select_table(NEW_TABLE_NAME)
# Act
table_names = store... | 25.046512 | 76 | 0.650882 | import pytest
from .fixtures import *
def test_rename_table(store):
NEW_TABLE_NAME = "new_table_name"
df = make_table()
store.write_table("table_name", df)
store.rename_table("table_name", to=NEW_TABLE_NAME)
table = store.select_table(NEW_TABLE_NAME)
table_names = store.list_tables()
... | true | true |
08efaa3edfed1dacef6ebe05381aeb5b1aa273aa | 5,585 | py | Python | celest/encounter/_encounter_math_utils.py | JaiWillems/SatPy | a46d01d14976828eabc63b4a86c6cb97e2ae4c41 | [
"BSD-3-Clause"
] | 6 | 2021-02-21T17:29:00.000Z | 2021-08-04T21:12:50.000Z | celest/encounter/_encounter_math_utils.py | JaiWillems/SatPy | a46d01d14976828eabc63b4a86c6cb97e2ae4c41 | [
"BSD-3-Clause"
] | 2 | 2021-04-19T18:09:27.000Z | 2021-11-14T00:31:40.000Z | celest/encounter/_encounter_math_utils.py | JaiWillems/SatPy | a46d01d14976828eabc63b4a86c6cb97e2ae4c41 | [
"BSD-3-Clause"
] | 1 | 2021-04-15T23:17:52.000Z | 2021-04-15T23:17:52.000Z | """Encounter indices utilities.
This module contains the geometric utilities necessary for analytical pass
analysis implementation.
"""
from typing import Literal
import numpy as np
def _cone_constraint(theta: np.array, U: np.array, X: np.array) -> np.array:
"""Return an array of indices for `X` points that fa... | 28.78866 | 79 | 0.609132 |
from typing import Literal
import numpy as np
def _cone_constraint(theta: np.array, U: np.array, X: np.array) -> np.array:
U_norm = np.repeat(np.linalg.norm(U, axis=1).reshape((-1, 1)), 3, axis=1)
D = np.divide(U, U_norm)
Y = X - U
d1, d2, d3 = D[:, 0], D[:, 1], D[:, 2]
y1, y2, y3 = Y[:, 0], Y... | true | true |
08efaaa4f4954e8d81147208d9801e176b8afbeb | 3,873 | py | Python | project/mymultigrid.py | amit17133129/pyMG-2016 | b82a60811bb0a8b91d8793c47177a240221f9176 | [
"BSD-2-Clause"
] | 2 | 2016-04-04T15:20:50.000Z | 2020-08-01T19:28:55.000Z | project/mymultigrid.py | amit17133129/pyMG-2016 | b82a60811bb0a8b91d8793c47177a240221f9176 | [
"BSD-2-Clause"
] | 1 | 2020-10-02T05:44:45.000Z | 2020-10-02T05:44:45.000Z | project/mymultigrid.py | amit17133129/pyMG-2016 | b82a60811bb0a8b91d8793c47177a240221f9176 | [
"BSD-2-Clause"
] | 11 | 2016-03-26T18:37:06.000Z | 2020-10-01T19:44:55.000Z | import scipy.sparse.linalg as sLA
import numpy as np
from pymg.multigrid_base import MultigridBase
class MyMultigrid(MultigridBase):
"""Implementation of a multigrid solver with different cycle implementations
"""
def __init__(self, ndofs, nlevels):
"""Initialization routine
"""
... | 32.822034 | 97 | 0.554609 | import scipy.sparse.linalg as sLA
import numpy as np
from pymg.multigrid_base import MultigridBase
class MyMultigrid(MultigridBase):
def __init__(self, ndofs, nlevels):
assert np.log2(ndofs+1) >= nlevels
super(MyMultigrid, self).__init__(ndofs, nlevels)
def do_v_cycle(self, v0, rhs, nu1, nu... | true | true |
08efaaae4ae4846a7cf4846f3f6e54a9731edf8f | 3,419 | py | Python | AWS/lambda_package/runbooks/AWS-EC2-010.py | nathanawmk/Prisma-Enhanced-Remediation | 360b889cc5838ed548e2985c5249476062239485 | [
"MIT"
] | 34 | 2020-08-18T19:46:37.000Z | 2022-03-31T05:21:29.000Z | AWS/lambda_package/runbooks/AWS-EC2-010.py | nathanawmk/Prisma-Enhanced-Remediation | 360b889cc5838ed548e2985c5249476062239485 | [
"MIT"
] | 3 | 2020-08-19T23:01:29.000Z | 2022-01-25T10:18:16.000Z | AWS/lambda_package/runbooks/AWS-EC2-010.py | nathanawmk/Prisma-Enhanced-Remediation | 360b889cc5838ed548e2985c5249476062239485 | [
"MIT"
] | 23 | 2020-09-11T03:52:04.000Z | 2022-03-22T09:32:02.000Z | """
Remediate Prisma Policy:
AWS:EC2-100 Global Admin Port Access Detected
Description:
Global permission to access the well-known services should not be allowed in a security group.
**Note: Remediation will be executed if the well-known service is found within a port range.
Required Permissions:
- ec2:DescribeSe... | 24.956204 | 133 | 0.616555 |
import json
import re
import boto3
from botocore.exceptions import ClientError
admin_port_list = [ 'tcp-20', 'tcp-21', 'tcp-25', 'tcp-53', 'tcp-3306', 'tcp-5432', 'tcp-1433', 'tcp-4333', 'tcp-5500', 'tcp-5900' ]
global_cidr_list = [ '0.0.0.0/0', '::/0' ]
def remediate(session, alert, lambda_context):
sg_id = a... | true | true |
08efab62ee2afd88da816a79e319ec1409ba945b | 2,893 | py | Python | torch_fuze/callbacks/mlflow_callback.py | Daiver/torch_fuze | 6b7ad568e2d7549c7f0c0d4c309532ac1b92881d | [
"MIT"
] | 1 | 2019-05-16T07:18:05.000Z | 2019-05-16T07:18:05.000Z | torch_fuze/callbacks/mlflow_callback.py | Daiver/torch_fuze | 6b7ad568e2d7549c7f0c0d4c309532ac1b92881d | [
"MIT"
] | null | null | null | torch_fuze/callbacks/mlflow_callback.py | Daiver/torch_fuze | 6b7ad568e2d7549c7f0c0d4c309532ac1b92881d | [
"MIT"
] | null | null | null | from ..trainer_state import TrainerState
from .abstract_callback import AbstractCallback
import os
import mlflow
class MLFlowCallback(AbstractCallback):
# TODO: i need clear solution for category/metric
def __init__(
self,
metrics_to_track: set=None,
lowest_metrics_to_trac... | 45.203125 | 115 | 0.654338 | from ..trainer_state import TrainerState
from .abstract_callback import AbstractCallback
import os
import mlflow
class MLFlowCallback(AbstractCallback):
def __init__(
self,
metrics_to_track: set=None,
lowest_metrics_to_track: set=None,
highest_metrics_to_track:... | true | true |
08efab8278bf70eb8b27d94bc32cbbe17807c55e | 495 | py | Python | home/views.py | tcysin/portfolio | 9f6faf88fda60fbb8ec8e087b7e024efdc683546 | [
"Apache-2.0"
] | null | null | null | home/views.py | tcysin/portfolio | 9f6faf88fda60fbb8ec8e087b7e024efdc683546 | [
"Apache-2.0"
] | null | null | null | home/views.py | tcysin/portfolio | 9f6faf88fda60fbb8ec8e087b7e024efdc683546 | [
"Apache-2.0"
] | null | null | null | from django.urls import reverse_lazy
from django.views.generic import FormView
from .forms import ContactForm
class ContactView(FormView):
template_name = "home/contact.html"
form_class = ContactForm
success_url = reverse_lazy("success")
def form_valid(self, form):
"""If the form is valid, s... | 29.117647 | 75 | 0.709091 | from django.urls import reverse_lazy
from django.views.generic import FormView
from .forms import ContactForm
class ContactView(FormView):
template_name = "home/contact.html"
form_class = ContactForm
success_url = reverse_lazy("success")
def form_valid(self, form):
return For... | true | true |
08efac28ec5749512053ce2bd8ba2d98c9d18570 | 5,557 | py | Python | nssrc/com/citrix/netscaler/nitro/resource/config/authentication/authenticationwebauthpolicy_authenticationvserver_binding.py | benfinke/ns_python | d651d7aa01d7dc63c1cd435c7b3314d7f5b26659 | [
"Apache-2.0"
] | 1 | 2015-04-05T21:21:26.000Z | 2015-04-05T21:21:26.000Z | nssrc/com/citrix/netscaler/nitro/resource/config/authentication/authenticationwebauthpolicy_authenticationvserver_binding.py | benfinke/ns_python | d651d7aa01d7dc63c1cd435c7b3314d7f5b26659 | [
"Apache-2.0"
] | 1 | 2017-01-20T22:56:58.000Z | 2017-01-20T22:56:58.000Z | nssrc/com/citrix/netscaler/nitro/resource/config/authentication/authenticationwebauthpolicy_authenticationvserver_binding.py | benfinke/ns_python | d651d7aa01d7dc63c1cd435c7b3314d7f5b26659 | [
"Apache-2.0"
] | 6 | 2015-04-21T13:14:08.000Z | 2020-12-03T07:27:52.000Z | #
# Copyright (c) 2008-2015 Citrix Systems, 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 l... | 30.36612 | 159 | 0.742487 |
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response
from nssrc.com.citrix.netscaler.nitro.service.options import options
from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro... | false | true |
08efad46a3852c784ff66ceb49863ad741b44168 | 74 | py | Python | src/cipr/commands/main.py | six8/corona-cipr | a2f45761080c874afa39bf95fd5c4467c8eae272 | [
"MIT"
] | 1 | 2015-04-19T20:53:15.000Z | 2015-04-19T20:53:15.000Z | src/cipr/commands/main.py | six8/corona-cipr | a2f45761080c874afa39bf95fd5c4467c8eae272 | [
"MIT"
] | null | null | null | src/cipr/commands/main.py | six8/corona-cipr | a2f45761080c874afa39bf95fd5c4467c8eae272 | [
"MIT"
] | 2 | 2016-04-11T15:35:10.000Z | 2020-04-13T10:42:32.000Z | from cipr.commands import app, core
def main():
app.command.main()
| 14.8 | 35 | 0.675676 | from cipr.commands import app, core
def main():
app.command.main()
| true | true |
08efafec06b0a5f6eee3bd564b95745940a8c323 | 3,157 | py | Python | tests/demo/demoproject/settings.py | GigiusB/djaxei | 2fd181acd8c10c259d4ffdfbcef03ea959222d6f | [
"MIT"
] | null | null | null | tests/demo/demoproject/settings.py | GigiusB/djaxei | 2fd181acd8c10c259d4ffdfbcef03ea959222d6f | [
"MIT"
] | null | null | null | tests/demo/demoproject/settings.py | GigiusB/djaxei | 2fd181acd8c10c259d4ffdfbcef03ea959222d6f | [
"MIT"
] | null | null | null | """
Django settings for demoproject project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import ... | 25.666667 | 91 | 0.697814 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'wms!w#0g!qmhy09pqwotiokkxagg&s6+rtp!s)bd%yru_-yx#2'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes... | true | true |
08efb020a6d921753be833312c3d8f1eb7a778bf | 9,666 | py | Python | team_code/transfuser_agent.py | Kait0/leaderboard | e44c169d541832439f98c70b33cfe6f7d89dfa31 | [
"MIT"
] | 1 | 2021-07-23T02:06:39.000Z | 2021-07-23T02:06:39.000Z | team_code/transfuser_agent.py | Kait0/leaderboard | e44c169d541832439f98c70b33cfe6f7d89dfa31 | [
"MIT"
] | null | null | null | team_code/transfuser_agent.py | Kait0/leaderboard | e44c169d541832439f98c70b33cfe6f7d89dfa31 | [
"MIT"
] | null | null | null | import os
import json
import datetime
import pathlib
import time
import cv2
import carla
from collections import deque
import torch
import carla
import numpy as np
from PIL import Image
from leaderboard.autoagents import autonomous_agent
from transfuser.model import TransFuser
from transfuser.config import GlobalConf... | 34.645161 | 143 | 0.66708 | import os
import json
import datetime
import pathlib
import time
import cv2
import carla
from collections import deque
import torch
import carla
import numpy as np
from PIL import Image
from leaderboard.autoagents import autonomous_agent
from transfuser.model import TransFuser
from transfuser.config import GlobalConf... | true | true |
08efb0f4a17e4cbc2367f7619bdce5da73dea996 | 3,952 | py | Python | bitbot/strategy/strategy.py | cayox/bitbot | 6fe5f7f7106bf925011b6d328755e6cdbadeb6e2 | [
"MIT"
] | null | null | null | bitbot/strategy/strategy.py | cayox/bitbot | 6fe5f7f7106bf925011b6d328755e6cdbadeb6e2 | [
"MIT"
] | null | null | null | bitbot/strategy/strategy.py | cayox/bitbot | 6fe5f7f7106bf925011b6d328755e6cdbadeb6e2 | [
"MIT"
] | null | null | null | from abc import abstractmethod
import json
from bitbot import services
from ta import momentum, trend
import pandas as pd
class TradingStrategyInterface:
"""
Description of TradingStrategyInterface
Attributes:
service (services.ServiceInterface): the service to be used for requests
config... | 38 | 246 | 0.641194 | from abc import abstractmethod
import json
from bitbot import services
from ta import momentum, trend
import pandas as pd
class TradingStrategyInterface:
def __init__(self, service: services.ServiceInterface, config: str or dict[str, any], market: str):
self.service = service
if isinstance(config... | true | true |
08efb11c7cfe7b76ce8b066ad287569f56b64c7e | 1,983 | py | Python | ai/search_tree/and_or_search/algo.py | fcracker79/artificial_intelligence_modern_approach_examples | 60d5d486f810d9d23fa110ebf02a1cb11ca2da2c | [
"MIT"
] | null | null | null | ai/search_tree/and_or_search/algo.py | fcracker79/artificial_intelligence_modern_approach_examples | 60d5d486f810d9d23fa110ebf02a1cb11ca2da2c | [
"MIT"
] | null | null | null | ai/search_tree/and_or_search/algo.py | fcracker79/artificial_intelligence_modern_approach_examples | 60d5d486f810d9d23fa110ebf02a1cb11ca2da2c | [
"MIT"
] | null | null | null | import itertools
import typing
State = typing.TypeVar('State')
Action = typing.TypeVar('Action')
UnconditionalSubplan = typing.NewType('UnconditionalSubplan', typing.Sequence[Action])
ConditionalSubplan = typing.NamedTuple(
'ConditionalSubplan',
(
('state', State),
('subplan', 'Plan')
)
)
... | 33.05 | 108 | 0.695915 | import itertools
import typing
State = typing.TypeVar('State')
Action = typing.TypeVar('Action')
UnconditionalSubplan = typing.NewType('UnconditionalSubplan', typing.Sequence[Action])
ConditionalSubplan = typing.NamedTuple(
'ConditionalSubplan',
(
('state', State),
('subplan', 'Plan')
)
)
... | true | true |
08efb18f23a32de24973e9c28d8137fed19dee97 | 189 | py | Python | scripts-python/teste01.py | Robert-Marchinhaki/primeiros-passos-Python | 515c2c418bfb941bd9af14cf598eca7fe2985592 | [
"MIT"
] | null | null | null | scripts-python/teste01.py | Robert-Marchinhaki/primeiros-passos-Python | 515c2c418bfb941bd9af14cf598eca7fe2985592 | [
"MIT"
] | null | null | null | scripts-python/teste01.py | Robert-Marchinhaki/primeiros-passos-Python | 515c2c418bfb941bd9af14cf598eca7fe2985592 | [
"MIT"
] | null | null | null | nome =input('Qual seu nome?')
idade =input('Qual sua idade?')
peso =input('Qual seu peso?')
print('A pessoa de nome '+ nome,'tem '+ idade, 'anos de idade ' + 'com ' + peso, 'kg de peso')
| 31.5 | 95 | 0.624339 | nome =input('Qual seu nome?')
idade =input('Qual sua idade?')
peso =input('Qual seu peso?')
print('A pessoa de nome '+ nome,'tem '+ idade, 'anos de idade ' + 'com ' + peso, 'kg de peso')
| true | true |
08efb1b3d850fe6f7ab1aa778da9b08b8be29536 | 3,022 | py | Python | gen_parameter.py | pdebuyl/f90h5md | 538bda2eebd5474489d963e16175aecdb750ab4d | [
"BSD-3-Clause"
] | 1 | 2019-10-17T15:57:45.000Z | 2019-10-17T15:57:45.000Z | gen_parameter.py | pdebuyl/f90h5md | 538bda2eebd5474489d963e16175aecdb750ab4d | [
"BSD-3-Clause"
] | null | null | null | gen_parameter.py | pdebuyl/f90h5md | 538bda2eebd5474489d963e16175aecdb750ab4d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright 2011-2013 Pierre de Buyl
#
# This file is part of f90h5md
#
# f90h5md is free software and is licensed under the modified BSD license (see
# LICENSE file).
types = dict()
types['i'] = 'integer'
types['d'] = 'double precision'
types['l'] = 'logical'
types['c'] = 'character'
H5T = dict... | 23.795276 | 78 | 0.515884 |
types = dict()
types['i'] = 'integer'
types['d'] = 'double precision'
types['l'] = 'logical'
types['c'] = 'character'
H5T = dict()
H5T['i'] = 'H5T_NATIVE_INTEGER'
H5T['d'] = 'H5T_NATIVE_DOUBLE'
H5T['c'] = 'a_type'
H5T['l'] = 'H5T_NATIVE_INTEGER'
dims = dict()
dims['s'] = ''
dims['1'] = '(:)'
dims['2'] = '(:,:)'
for ... | false | true |
08efb347ba08496c765b5397f55ce14c266ab97d | 575 | py | Python | api_backend/migrations/0001_initial.py | md-abdul-alim/Basic-Django-Rest-Framework | 9c2d764961d639a8ab4b112ad911daa5c5c19dcb | [
"MIT"
] | null | null | null | api_backend/migrations/0001_initial.py | md-abdul-alim/Basic-Django-Rest-Framework | 9c2d764961d639a8ab4b112ad911daa5c5c19dcb | [
"MIT"
] | 1 | 2021-02-05T10:37:42.000Z | 2021-02-05T10:37:42.000Z | api_backend/migrations/0001_initial.py | md-abdul-alim/Django-Rest-Framework-Ajax | 9c2d764961d639a8ab4b112ad911daa5c5c19dcb | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2021-02-02 17:33
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Task',
fields=[
('id', models.AutoField(aut... | 25 | 114 | 0.58087 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Task',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=Fals... | true | true |
08efb46d6f075c33d65eab57d06e13176896374f | 1,301 | py | Python | protein_surface_calculator.py | SiliconScientist/protein-surface-calculator | ffc1243c2f65d359006a039fb2cdae92005916dd | [
"MIT"
] | null | null | null | protein_surface_calculator.py | SiliconScientist/protein-surface-calculator | ffc1243c2f65d359006a039fb2cdae92005916dd | [
"MIT"
] | null | null | null | protein_surface_calculator.py | SiliconScientist/protein-surface-calculator | ffc1243c2f65d359006a039fb2cdae92005916dd | [
"MIT"
] | null | null | null | import os
import freesasa
import numpy as np
taxa = ['psychro', 'thermo']
num_taxa = len(taxa)
# Create empty arrays to contain the ratios or their averages
ratio = [[] for i in range(num_taxa)]
ratio_mean = []
# Loop for each taxa
for i in range(num_taxa):
# Locate folder for use use
path = f'/Users/averyhi... | 31.731707 | 121 | 0.692544 | import os
import freesasa
import numpy as np
taxa = ['psychro', 'thermo']
num_taxa = len(taxa)
ratio = [[] for i in range(num_taxa)]
ratio_mean = []
for i in range(num_taxa):
path = f'/Users/averyhill/MyDocuments/schoeffler_research_summer_2021/pdbs/{taxa[i]}philes/{taxa[i]}_gyra_pdb_folder'
file_array =... | true | true |
08efb4f523ca06223daf9863a563bebe932e5046 | 659 | py | Python | var/spack/repos/builtin/packages/py-youtube-dl/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/py-youtube-dl/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/py-youtube-dl/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 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 PyYoutubeDl(PythonPackage):
"""Command-line program to download videos from YouTube.com an... | 32.95 | 99 | 0.737481 |
from spack import *
class PyYoutubeDl(PythonPackage):
homepage = "https://github.com/ytdl-org/youtube-dl"
pypi = "youtube_dl/youtube_dl-2020.3.24.tar.gz"
version('2020.3.24', sha256='4b03efe439f7cae26eba909821d1df00a9a4eb82741cb2e8b78fe29702bd4633')
depends_on('py-setuptools', type=('build', 'run'... | true | true |
08efb5032fd2ed4059f628b3d3c40f5835d4c715 | 5,365 | py | Python | tensorflow_lite_support/metadata/python/metadata_writers/image_classifier.py | tinder-maxwellelliott/tflite-support | 0ca3b83efee160858084882a5088141d4202c383 | [
"Apache-2.0"
] | 2 | 2021-04-09T17:03:54.000Z | 2021-06-16T09:43:23.000Z | tensorflow_lite_support/metadata/python/metadata_writers/image_classifier.py | NobuoTsukamoto/tflite-support | 0fb26483f36327f340da114b29d24218f5d89134 | [
"Apache-2.0"
] | null | null | null | tensorflow_lite_support/metadata/python/metadata_writers/image_classifier.py | NobuoTsukamoto/tflite-support | 0fb26483f36327f340da114b29d24218f5d89134 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.954198 | 155 | 0.718173 |
from typing import List, Optional
from tensorflow_lite_support.metadata import metadata_schema_py_generated as _metadata_fb
from tensorflow_lite_support.metadata.python.metadata_writers import metadata_info
from tensorflow_lite_support.metadata.python.metadata_writers import metadata_writer
from tensorflow_lite_suppo... | true | true |
08efb6d5d4c9833fa321b18cccaf65b263690788 | 1,725 | py | Python | tests/parsers/ios_lockdownd.py | rick-slin/plaso | 8685bd1689cbbaea78ebf723881a842eeaf94c35 | [
"Apache-2.0"
] | null | null | null | tests/parsers/ios_lockdownd.py | rick-slin/plaso | 8685bd1689cbbaea78ebf723881a842eeaf94c35 | [
"Apache-2.0"
] | null | null | null | tests/parsers/ios_lockdownd.py | rick-slin/plaso | 8685bd1689cbbaea78ebf723881a842eeaf94c35 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the iOS lockdown daemon log files parser."""
import unittest
from plaso.parsers import ios_lockdownd
from tests.parsers import test_lib
class IOSLockdownLogUnitTest(test_lib.ParserTestCase):
"""Tests for the iOS lockdown daemon log files parser."""
d... | 32.54717 | 77 | 0.682899 |
import unittest
from plaso.parsers import ios_lockdownd
from tests.parsers import test_lib
class IOSLockdownLogUnitTest(test_lib.ParserTestCase):
def testParseLog(self):
parser = ios_lockdownd.IOSLockdownParser()
storage_writer = self._ParseFile(['ios_lockdownd.log'], parser)
number_of_events = sto... | true | true |
08efb6fc35b5d0f135b6478831c6dfc20eeb9e4c | 1,314 | py | Python | azure-common/azure/common/__init__.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | null | null | null | azure-common/azure/common/__init__.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | null | null | null | azure-common/azure/common/__init__.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | null | null | null | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
__author__... | 35.513514 | 81 | 0.633942 |
__author__ = 'Microsoft Corp. <azpysdkhelp@microsoft.com>'
__version__ = '1.1.11'
class AzureException(Exception):
pass
class AzureHttpError(AzureException):
def __init__(self, message, status_code):
super(AzureHttpError, self).__init__(message)
self.status_code = status_code
def __ne... | false | true |
08efb7fad125e0f8df11d7812e3bb8d040e39738 | 17,851 | py | Python | tests/wallet/cc_wallet/test_trades.py | yuanliuus/thyme-blockchain | 9ea5cddc78f601fcbe77101d74147cf8190e423d | [
"Apache-2.0"
] | 6 | 2021-06-30T13:03:47.000Z | 2021-07-10T12:46:37.000Z | tests/wallet/cc_wallet/test_trades.py | yuanliuus/thyme-blockchain | 9ea5cddc78f601fcbe77101d74147cf8190e423d | [
"Apache-2.0"
] | 8 | 2021-07-01T15:45:09.000Z | 2021-09-08T04:30:46.000Z | tests/wallet/cc_wallet/test_trades.py | yuanliuus/thyme-blockchain | 9ea5cddc78f601fcbe77101d74147cf8190e423d | [
"Apache-2.0"
] | 11 | 2021-07-03T17:30:57.000Z | 2022-03-15T08:47:03.000Z | import asyncio
import time
from pathlib import Path
from secrets import token_bytes
import pytest
from thyme.simulator.simulator_protocol import FarmNewBlockProtocol
from thyme.types.peer_info import PeerInfo
from thyme.util.ints import uint16, uint64
from thyme.wallet.cc_wallet.cc_wallet import CCWallet
from thyme.w... | 38.975983 | 117 | 0.708364 | import asyncio
import time
from pathlib import Path
from secrets import token_bytes
import pytest
from thyme.simulator.simulator_protocol import FarmNewBlockProtocol
from thyme.types.peer_info import PeerInfo
from thyme.util.ints import uint16, uint64
from thyme.wallet.cc_wallet.cc_wallet import CCWallet
from thyme.w... | true | true |
08efb8ce618e761a77d525dc86dabaf78b8d4e7b | 46,361 | py | Python | tcfl/tc_jtreg.py | intel/tcf | f194cc913d31ec7fbd86082d1aa7643211936d05 | [
"Apache-2.0"
] | 24 | 2018-08-21T18:04:48.000Z | 2022-02-07T22:50:06.000Z | tcfl/tc_jtreg.py | intel/tcf | f194cc913d31ec7fbd86082d1aa7643211936d05 | [
"Apache-2.0"
] | 16 | 2018-08-21T18:03:52.000Z | 2022-03-01T17:15:42.000Z | tcfl/tc_jtreg.py | intel/tcf | f194cc913d31ec7fbd86082d1aa7643211936d05 | [
"Apache-2.0"
] | 29 | 2018-08-22T19:40:59.000Z | 2021-12-21T11:13:23.000Z | #! /usr/bin/python3
#
# Copyright (c) 2019 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
# pylint: disable = missing-docstring
#
#
#
# Long:
#
# jdk11u.git/test/hotspot/jtreg/vmTestbase/gc/ArrayJuggle/Juggle14
#
# Individual:
#
# jdk8u.git/hotspot/agent/test/jdi/sagtest.java
# jdk11u.git/test/hotspot/jtre... | 42.146364 | 233 | 0.629667 | # Failures: 0, Skips: 0", then ignore it, just log it, not rpeort
# subcase.
#
# javax/sql/testng/util/StubContext.java
#
# - When eval_10_execute times out, we need to parse whichever jtrs
# finished (pass/faield etc) to report them properly instead of err
#
# - parse timeout tags / factor // @run CODE/CODE/@t... | true | true |
08efba23bb7b2119ddd4d35b10e971ca698b9575 | 390 | py | Python | detectron2/modeling/backbone/__init__.py | crmauceri/detectron2 | cce3e24645f44b922fb2180dad67a8be5373b3b2 | [
"Apache-2.0"
] | null | null | null | detectron2/modeling/backbone/__init__.py | crmauceri/detectron2 | cce3e24645f44b922fb2180dad67a8be5373b3b2 | [
"Apache-2.0"
] | null | null | null | detectron2/modeling/backbone/__init__.py | crmauceri/detectron2 | cce3e24645f44b922fb2180dad67a8be5373b3b2 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from .build import build_backbone, BACKBONE_REGISTRY # noqa F401 isort:skip
from .backbone import Backbone
from .fpn import FPN
from .resnet import ResNet, ResNetBlockBase, build_resnet_backbone, make_stage
from .deeplab import build_deeplab_backb... | 39 | 78 | 0.820513 | from .build import build_backbone, BACKBONE_REGISTRY
from .backbone import Backbone
from .fpn import FPN
from .resnet import ResNet, ResNetBlockBase, build_resnet_backbone, make_stage
from .deeplab import build_deeplab_backbone
| true | true |
08efba430500964b7383521438858aa62a6d386a | 637 | py | Python | tests/rules/test_has_exists_script.py | jlandrum/theheck | d2c008b6ca14220504be95f887253ddd9f5e9f72 | [
"MIT"
] | null | null | null | tests/rules/test_has_exists_script.py | jlandrum/theheck | d2c008b6ca14220504be95f887253ddd9f5e9f72 | [
"MIT"
] | null | null | null | tests/rules/test_has_exists_script.py | jlandrum/theheck | d2c008b6ca14220504be95f887253ddd9f5e9f72 | [
"MIT"
] | null | null | null | from mock import patch
from theheck.rules.has_exists_script import match, get_new_command
from theheck.types import Command
def test_match():
with patch('os.path.exists', return_value=True):
assert match(Command('main', 'main: command not found'))
assert match(Command('main --help',
... | 33.526316 | 73 | 0.654631 | from mock import patch
from theheck.rules.has_exists_script import match, get_new_command
from theheck.types import Command
def test_match():
with patch('os.path.exists', return_value=True):
assert match(Command('main', 'main: command not found'))
assert match(Command('main --help',
... | true | true |
08efba65d3a5878c80bccf9bb58d527b85a5bff3 | 1,139 | py | Python | RestBlog/apps/statistics_article/models.py | xeroCBW/testmodel | 6000d79f91d11bcf6ba76befb3a94a007231ecdc | [
"MIT"
] | null | null | null | RestBlog/apps/statistics_article/models.py | xeroCBW/testmodel | 6000d79f91d11bcf6ba76befb3a94a007231ecdc | [
"MIT"
] | 54 | 2020-06-24T07:12:19.000Z | 2022-03-12T00:43:57.000Z | RestBlog/apps/statistics_article/models.py | xeroCBW/testmodel | 6000d79f91d11bcf6ba76befb3a94a007231ecdc | [
"MIT"
] | null | null | null | from django.db import models
from django.db.models.fields import exceptions
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.utils import timezone
class ReadNum(models.Model):
read_num = models.IntegerField(default=0)
cont... | 34.515152 | 78 | 0.752414 | from django.db import models
from django.db.models.fields import exceptions
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.utils import timezone
class ReadNum(models.Model):
read_num = models.IntegerField(default=0)
cont... | true | true |
08efbb6f129da690646822d58e49308fc4a9ea8b | 2,838 | py | Python | altar/shells/Application.py | gracebato/altar | 87adc90b7f2a8b9452adabe0404035a880012e8c | [
"BSD-3-Clause"
] | null | null | null | altar/shells/Application.py | gracebato/altar | 87adc90b7f2a8b9452adabe0404035a880012e8c | [
"BSD-3-Clause"
] | null | null | null | altar/shells/Application.py | gracebato/altar | 87adc90b7f2a8b9452adabe0404035a880012e8c | [
"BSD-3-Clause"
] | null | null | null | # -*- python -*-
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis <michael.aivazis@para-sim.com>
#
# (c) 2013-2018 parasim inc
# (c) 2010-2018 california institute of technology
# all rights reserved
#
# support
import altar
# the simple application shell
class Application(altar.application, family="altar.shells.app... | 28.38 | 93 | 0.633897 |
import altar
class Application(altar.application, family="altar.shells.application"):
job = altar.simulations.run()
job.doc = "the job input parameters"
model = altar.models.model()
model.doc = "the AlTar model to sample"
rng = altar.simulations.rng()
rng.doc = "the random number gene... | true | true |
08efbbc309281ce61427c0a592018d6aaedac942 | 3,410 | py | Python | menpo3d/io/output/mesh.py | nontas/menpo3d | f29324b12a147f5b716ae5c3048d2c6b7a298752 | [
"BSD-3-Clause"
] | 3 | 2021-10-03T19:49:04.000Z | 2022-02-11T10:48:05.000Z | menpo3d/io/output/mesh.py | nontas/menpo3d | f29324b12a147f5b716ae5c3048d2c6b7a298752 | [
"BSD-3-Clause"
] | null | null | null | menpo3d/io/output/mesh.py | nontas/menpo3d | f29324b12a147f5b716ae5c3048d2c6b7a298752 | [
"BSD-3-Clause"
] | 1 | 2021-12-21T01:13:24.000Z | 2021-12-21T01:13:24.000Z | import numpy as np
from menpo.io.output.base import _enforce_only_paths_supported
from menpo.shape.mesh import TexturedTriMesh
def obj_exporter(mesh, file_handle, **kwargs):
r"""
Given a file handle to write in to (which should act like a Python `file`
object), write out the mesh data. No value is return... | 37.065217 | 87 | 0.667155 | import numpy as np
from menpo.io.output.base import _enforce_only_paths_supported
from menpo.shape.mesh import TexturedTriMesh
def obj_exporter(mesh, file_handle, **kwargs):
for v in mesh.points:
file_handle.write('v {} {} {}\n'.format(*v).encode('utf-8'))
file_handle.write(b'\n')
if isinstance(m... | true | true |
08efbc809452a89d6aab5aaf4d8e082b71392cb7 | 1,027 | py | Python | pybb/models/__init__.py | thoas/pybbm | 0e7ab7ef60f15951660015f2b9be0ff7192f1095 | [
"BSD-2-Clause"
] | 1 | 2015-05-18T09:19:30.000Z | 2015-05-18T09:19:30.000Z | pybb/models/__init__.py | ulule/pybbm | 0e7ab7ef60f15951660015f2b9be0ff7192f1095 | [
"BSD-2-Clause"
] | 5 | 2017-06-13T16:25:34.000Z | 2018-07-17T20:30:56.000Z | pybb/models/__init__.py | ulule/pybbm | 0e7ab7ef60f15951660015f2b9be0ff7192f1095 | [
"BSD-2-Clause"
] | 1 | 2018-10-29T13:12:59.000Z | 2018-10-29T13:12:59.000Z | from pybb import defaults
from pybb.util import load_class
from pybb.models.base import BaseTopicRedirection, PostDeletion # NOQA
class TopicRedirection(BaseTopicRedirection):
class Meta(BaseTopicRedirection.Meta):
abstract = False
Moderator = load_class(defaults.PYBB_MODERATOR_MODEL)
Forum = load_cla... | 33.129032 | 71 | 0.847128 | from pybb import defaults
from pybb.util import load_class
from pybb.models.base import BaseTopicRedirection, PostDeletion
class TopicRedirection(BaseTopicRedirection):
class Meta(BaseTopicRedirection.Meta):
abstract = False
Moderator = load_class(defaults.PYBB_MODERATOR_MODEL)
Forum = load_class(defa... | true | true |
08efbc89c7bd6e9c8b6c5a9918ba4256256828b2 | 1,018 | py | Python | conan/conanfile.py | MarkusJx/CppJsLib | fab53b10736da25b7230382a473dfff4a6780ae6 | [
"MIT"
] | null | null | null | conan/conanfile.py | MarkusJx/CppJsLib | fab53b10736da25b7230382a473dfff4a6780ae6 | [
"MIT"
] | null | null | null | conan/conanfile.py | MarkusJx/CppJsLib | fab53b10736da25b7230382a473dfff4a6780ae6 | [
"MIT"
] | null | null | null | import os
from conans import ConanFile, CMake, tools
class CppJsLibConan(ConanFile):
name = "CppJsLib"
version = "0.8"
license = "MIT"
author = "MarkusJx"
url = "https://github.com/MarkusJx/CppJsLib"
description = "A library for cpp and js communication"
topics = ("C++", "Javascript")
n... | 31.8125 | 70 | 0.64833 | import os
from conans import ConanFile, CMake, tools
class CppJsLibConan(ConanFile):
name = "CppJsLib"
version = "0.8"
license = "MIT"
author = "MarkusJx"
url = "https://github.com/MarkusJx/CppJsLib"
description = "A library for cpp and js communication"
topics = ("C++", "Javascript")
n... | true | true |
08efbcbd76100cfae2a8156d3cb253b1c7e47a86 | 519 | py | Python | tmfeedback/clubs/migrations/0006_auto_20200721_1213.py | Andrew-Whitaker/tm-feedback | dd9bc3cc3427fef6e6c06add4ade77def6a6f7ac | [
"MIT"
] | null | null | null | tmfeedback/clubs/migrations/0006_auto_20200721_1213.py | Andrew-Whitaker/tm-feedback | dd9bc3cc3427fef6e6c06add4ade77def6a6f7ac | [
"MIT"
] | 6 | 2020-07-19T14:35:09.000Z | 2021-09-22T19:27:33.000Z | tmfeedback/clubs/migrations/0006_auto_20200721_1213.py | Andrew-Whitaker/tm-feedback | dd9bc3cc3427fef6e6c06add4ade77def6a6f7ac | [
"MIT"
] | null | null | null | # Generated by Django 3.0.7 on 2020-07-21 19:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('clubs', '0005_club_member_count'),
]
operations = [
migrations.RemoveField(
model_name='club',
name='tm_id',
... | 22.565217 | 92 | 0.581888 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('clubs', '0005_club_member_count'),
]
operations = [
migrations.RemoveField(
model_name='club',
name='tm_id',
),
migrations.AlterField(
m... | true | true |
08efbd91987af52d176eb5607d3eaf48c69bc60c | 89,509 | py | Python | airflow/providers/google/cloud/operators/bigquery.py | wegamekinglc/incubator-airflow | fc174635b0729253a86e8c877d6d8551a815a2cb | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-03-03T01:44:04.000Z | 2021-03-03T01:44:04.000Z | airflow/providers/google/cloud/operators/bigquery.py | wegamekinglc/incubator-airflow | fc174635b0729253a86e8c877d6d8551a815a2cb | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/providers/google/cloud/operators/bigquery.py | wegamekinglc/incubator-airflow | fc174635b0729253a86e8c877d6d8551a815a2cb | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-03-03T01:44:08.000Z | 2021-03-03T01:44:08.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... | 42.381155 | 109 | 0.668536 |
import enum
import hashlib
import json
import re
import uuid
import warnings
from datetime import datetime
from typing import Any, Dict, Iterable, List, Optional, Sequence, Set, SupportsAbs, Union
import attr
from google.api_core.exceptions import Conflict
from google.cloud.bigquery import TableReference
from airflo... | true | true |
08efbe0827e1ec896b71d81806a7a62fcce401c4 | 2,785 | py | Python | lh_calib/simulation/debias_effect.py | m1m0r1/lh_calib | ff16083e0250517ee7a18aab1931d2a576736bc8 | [
"MIT"
] | null | null | null | lh_calib/simulation/debias_effect.py | m1m0r1/lh_calib | ff16083e0250517ee7a18aab1931d2a576736bc8 | [
"MIT"
] | 1 | 2021-05-05T09:33:54.000Z | 2021-05-07T15:43:32.000Z | lh_calib/simulation/debias_effect.py | m1m0r1/lh_calib | ff16083e0250517ee7a18aab1931d2a576736bc8 | [
"MIT"
] | null | null | null | import logging
import pandas as pd
import numpy as np
import scipy
from argtools import command, argument
from tqdm import tqdm
import sys
sys.path.insert(0, __file__.rsplit('/', 3)[0])
from lh_calib import evaluation
from lh_calib import predictions
import itertools
def create_probs(N, alpha=1., K=2):
p_mat = np.... | 35.253165 | 113 | 0.630162 | import logging
import pandas as pd
import numpy as np
import scipy
from argtools import command, argument
from tqdm import tqdm
import sys
sys.path.insert(0, __file__.rsplit('/', 3)[0])
from lh_calib import evaluation
from lh_calib import predictions
import itertools
def create_probs(N, alpha=1., K=2):
p_mat = np.... | true | true |
08efbe86e1889fbd5f98f74358b072104a3c210d | 5,254 | py | Python | Linux_Android_Classification/Src/functions.py | Syuukakou/DeepLook_into_Android-type_ELF | ef021f893b9c257aea77a06f5383857e382c74fe | [
"MIT"
] | null | null | null | Linux_Android_Classification/Src/functions.py | Syuukakou/DeepLook_into_Android-type_ELF | ef021f893b9c257aea77a06f5383857e382c74fe | [
"MIT"
] | null | null | null | Linux_Android_Classification/Src/functions.py | Syuukakou/DeepLook_into_Android-type_ELF | ef021f893b9c257aea77a06f5383857e382c74fe | [
"MIT"
] | null | null | null | import csv
import json
import os.path
import pandas as pd
def get_sample_hashcodes(file):
with open(file, "r") as f:
data = json.load(f)
return list(data.keys())
def cfg_hashcodes(file):
hash_codes = []
with open(file, "r") as f:
for line in f:
hash_codes.append(line.str... | 35.5 | 122 | 0.584317 | import csv
import json
import os.path
import pandas as pd
def get_sample_hashcodes(file):
with open(file, "r") as f:
data = json.load(f)
return list(data.keys())
def cfg_hashcodes(file):
hash_codes = []
with open(file, "r") as f:
for line in f:
hash_codes.append(line.str... | true | true |
08efbf269bb242eb050ad158d3b3335a5c5d3aa3 | 20,691 | py | Python | influxdb_client/domain/notification_rule_base.py | bonitoo-io/influxdb-client-python | 465476b33648ba399a8f3e13d8780f7b3fe51950 | [
"MIT"
] | 1 | 2019-09-06T10:06:09.000Z | 2019-09-06T10:06:09.000Z | influxdb_client/domain/notification_rule_base.py | bonitoo-io/influxdb-client-python | 465476b33648ba399a8f3e13d8780f7b3fe51950 | [
"MIT"
] | 5 | 2019-08-06T04:58:58.000Z | 2019-09-05T09:09:40.000Z | influxdb_client/domain/notification_rule_base.py | bonitoo-io/influxdb-client-python | 465476b33648ba399a8f3e13d8780f7b3fe51950 | [
"MIT"
] | 1 | 2019-08-05T05:46:55.000Z | 2019-08-05T05:46:55.000Z | # coding: utf-8
"""
InfluxDB OSS API Service.
The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. # noqa: E501
OpenAPI spec version: 2.0.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa:... | 31.02099 | 410 | 0.614083 |
import pprint
import re
class NotificationRuleBase(object):
openapi_types = {
'latest_completed': 'datetime',
'last_run_status': 'str',
'last_run_error': 'str',
'id': 'str',
'endpoint_id': 'str',
'org_id': 'str',
'task_id': 'str',
'owner_id': 's... | true | true |
08efbf350ff697e1b2e3db1edb2c664bf334b074 | 1,954 | py | Python | bzsp/core.py | Floozutter/buzzspike | fadb44bcae234695e19cee9ecf27e8f7afe0515d | [
"Unlicense"
] | null | null | null | bzsp/core.py | Floozutter/buzzspike | fadb44bcae234695e19cee9ecf27e8f7afe0515d | [
"Unlicense"
] | 1 | 2021-06-11T12:54:01.000Z | 2021-07-05T08:09:08.000Z | bzsp/core.py | Floozutter/buzzspike | fadb44bcae234695e19cee9ecf27e8f7afe0515d | [
"Unlicense"
] | null | null | null | from . import recog
import cv2
import numpy
from numpy import ndarray
from typing import Iterable
def handle_source(source: Iterable[ndarray], delay: int) -> None:
maskname = ""
show_green_chevrons = True
show_green_boxes = True
show_red_chevrons = True
show_red_boxes = True
for frame in source... | 36.867925 | 75 | 0.535824 | from . import recog
import cv2
import numpy
from numpy import ndarray
from typing import Iterable
def handle_source(source: Iterable[ndarray], delay: int) -> None:
maskname = ""
show_green_chevrons = True
show_green_boxes = True
show_red_chevrons = True
show_red_boxes = True
for frame in source... | true | true |
08efbf3ffcd03353aa7fd43c5addc113972b8c54 | 2,313 | py | Python | fixtures/escape_sequence_files/run_tests.py | DLunin/xterm.js | 8d67bee0466ffcf7569b52d430fc90d73b78acb7 | [
"MIT"
] | 10,276 | 2017-11-01T15:27:30.000Z | 2022-03-31T22:35:24.000Z | fixtures/escape_sequence_files/run_tests.py | DLunin/xterm.js | 8d67bee0466ffcf7569b52d430fc90d73b78acb7 | [
"MIT"
] | 1,973 | 2017-11-01T15:46:24.000Z | 2022-03-31T17:22:41.000Z | fixtures/escape_sequence_files/run_tests.py | DLunin/xterm.js | 8d67bee0466ffcf7569b52d430fc90d73b78acb7 | [
"MIT"
] | 1,131 | 2017-11-05T09:28:40.000Z | 2022-03-31T21:04:04.000Z | from glob import glob
import os
import sys
import termios
import atexit
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
def enable_echo(fd, enabled):
(iflag, oflag, cflag, lflag, ispeed, ospeed, cc) = termios.tcgetattr(fd)
if enabled:
lflag |= termios.ECHO
else:
lflag &= ~termios.EC... | 31.256757 | 99 | 0.571552 | from glob import glob
import os
import sys
import termios
import atexit
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
def enable_echo(fd, enabled):
(iflag, oflag, cflag, lflag, ispeed, ospeed, cc) = termios.tcgetattr(fd)
if enabled:
lflag |= termios.ECHO
else:
lflag &= ~termios.EC... | false | true |
08efc16f860d8f5c9abfccd380bf5e29b81c1fa2 | 8,237 | py | Python | pyeparse/edf/_defines.py | Eric89GXL/pyeparse | c1907c39276aacb0fad80034d69b537b07f82786 | [
"BSD-3-Clause"
] | null | null | null | pyeparse/edf/_defines.py | Eric89GXL/pyeparse | c1907c39276aacb0fad80034d69b537b07f82786 | [
"BSD-3-Clause"
] | null | null | null | pyeparse/edf/_defines.py | Eric89GXL/pyeparse | c1907c39276aacb0fad80034d69b537b07f82786 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This file contains all the #define values from the edfapi header files.
A couple extra have been added as well.
Some of the constants are grouped into dicts, where both k,v and v,k entries
are added so it is easy to go from either the int -> str constant or str -> int
constant value for eac... | 35.813043 | 79 | 0.738497 |
def create_constants(var_val_dict):
constants = dict([(key, val) for key, val in dict(var_val_dict).items()
if (not key.startswith("_") and not callable(val))])
constants.update([(val, key) for key, val in dict(constants).items()])
return constants
event_constants = cr... | true | true |
08efc1a895fa0dbb95451eca5419cc309f3b2bb3 | 1,845 | py | Python | samples/cloudfiles/delete_objects.py | jfreeman812/pyrax | dba18df916dcc3a9f539bd9c609b1bb68f3d9203 | [
"Apache-2.0"
] | null | null | null | samples/cloudfiles/delete_objects.py | jfreeman812/pyrax | dba18df916dcc3a9f539bd9c609b1bb68f3d9203 | [
"Apache-2.0"
] | 1 | 2019-11-06T20:21:59.000Z | 2019-11-06T20:21:59.000Z | samples/cloudfiles/delete_objects.py | jfreeman812/pyrax | dba18df916dcc3a9f539bd9c609b1bb68f3d9203 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c)2012 Rackspace US, 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.ap... | 29.285714 | 83 | 0.711111 |
from __future__ import print_function
import os
import time
import pyrax
import pyrax.exceptions as exc
pyrax.set_setting("identity_type", "rackspace")
creds_file = os.path.expanduser("~/.rackspace_cloud_credentials")
pyrax.set_credential_file(creds_file)
cf = pyrax.cloudfiles
cont_name = pyrax.utils.random_ascii... | true | true |
08efc1b7b2b4e577d52abf85a90a5a0eca860d15 | 3,945 | py | Python | ceilometer/image/notifications.py | aristanetworks/ceilometer | 8776b137f82f71eef1241bcb1600de10c1f77394 | [
"Apache-2.0"
] | 2 | 2015-09-07T09:15:26.000Z | 2015-09-30T02:13:23.000Z | ceilometer/image/notifications.py | aristanetworks/ceilometer | 8776b137f82f71eef1241bcb1600de10c1f77394 | [
"Apache-2.0"
] | null | null | null | ceilometer/image/notifications.py | aristanetworks/ceilometer | 8776b137f82f71eef1241bcb1600de10c1f77394 | [
"Apache-2.0"
] | 1 | 2019-09-16T02:11:41.000Z | 2019-09-16T02:11:41.000Z | #
# Copyright 2012 Red Hat, Inc
#
# Author: Eoghan Glynn <eglynn@redhat.com>
#
# 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 req... | 30.581395 | 77 | 0.627123 |
from oslo.config import cfg
import oslo.messaging
from ceilometer import plugin
from ceilometer import sample
OPTS = [
cfg.StrOpt('glance_control_exchange',
default='glance',
help="Exchange name for Glance notifications."),
]
cfg.CONF.register_opts(OPTS)
class ImageBase(plugin.N... | true | true |
08efc1bb03e577411c04864f91ecffed2412d465 | 1,578 | py | Python | rwge/views.py | rwgeaston/django-rwge | 197779531a99de1077feea656ac79be1c5a8119c | [
"MIT"
] | null | null | null | rwge/views.py | rwgeaston/django-rwge | 197779531a99de1077feea656ac79be1c5a8119c | [
"MIT"
] | null | null | null | rwge/views.py | rwgeaston/django-rwge | 197779531a99de1077feea656ac79be1c5a8119c | [
"MIT"
] | null | null | null | import logging
from json import loads
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from .rwge import get_response
logger = logging.getLogger('rwge')
@csrf_exempt
def rwge_view(request):
payload = loads(request.body)
logger.info(payload)
response = {}
i... | 30.941176 | 108 | 0.69455 | import logging
from json import loads
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt
from .rwge import get_response
logger = logging.getLogger('rwge')
@csrf_exempt
def rwge_view(request):
payload = loads(request.body)
logger.info(payload)
response = {}
i... | true | true |
08efc1e664715d0886f8d1b236e241b37158ec87 | 6,568 | py | Python | homeassistant/components/blackbird/media_player.py | joopert/home-assistant | a3f6fbb3774004b15c397c0556f98c5f7a59cb22 | [
"Apache-2.0"
] | 3 | 2020-10-23T14:39:11.000Z | 2021-02-17T14:40:17.000Z | homeassistant/components/blackbird/media_player.py | joopert/home-assistant | a3f6fbb3774004b15c397c0556f98c5f7a59cb22 | [
"Apache-2.0"
] | 3 | 2021-02-08T20:54:46.000Z | 2021-09-08T02:30:04.000Z | homeassistant/components/blackbird/media_player.py | joopert/home-assistant | a3f6fbb3774004b15c397c0556f98c5f7a59cb22 | [
"Apache-2.0"
] | 4 | 2020-05-30T08:19:47.000Z | 2021-05-14T11:39:19.000Z | """Support for interfacing with Monoprice Blackbird 4k 8x8 HDBaseT Matrix."""
import logging
import socket
from pyblackbird import get_blackbird
from serial import SerialException
import voluptuous as vol
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerDevice
from homeassistant.component... | 30.407407 | 88 | 0.65134 | import logging
import socket
from pyblackbird import get_blackbird
from serial import SerialException
import voluptuous as vol
from homeassistant.components.media_player import PLATFORM_SCHEMA, MediaPlayerDevice
from homeassistant.components.media_player.const import (
SUPPORT_SELECT_SOURCE,
SUPPORT_TURN_OFF,... | true | true |
08efc2c6545af56cb3be14fd0ab8e3210f3e4e82 | 1,211 | py | Python | algorithms/prime_37percent.py | yehyafarhat1/cis667-secretary-problem | c10cfaa82869d8a0010af40d2d6b0087247a0325 | [
"MIT"
] | null | null | null | algorithms/prime_37percent.py | yehyafarhat1/cis667-secretary-problem | c10cfaa82869d8a0010af40d2d6b0087247a0325 | [
"MIT"
] | null | null | null | algorithms/prime_37percent.py | yehyafarhat1/cis667-secretary-problem | c10cfaa82869d8a0010af40d2d6b0087247a0325 | [
"MIT"
] | null | null | null | import math
import sys
class Prime_37percent:
def __init__(self):
self.current_best_val = sys.float_info.min
self.current_best_index = -1
self.current_iteration_count = 0
self.list_historical_candidates = []
pass
def name(self):
return "Prime 37 percent algori... | 32.72973 | 108 | 0.663088 | import math
import sys
class Prime_37percent:
def __init__(self):
self.current_best_val = sys.float_info.min
self.current_best_index = -1
self.current_iteration_count = 0
self.list_historical_candidates = []
pass
def name(self):
return "Prime 37 percent algori... | true | true |
08efc35b28874f1efb2298b20e40a0ba0e7485ae | 1,664 | py | Python | spritesheet.py | Juanpam/Pakman | 487b288bac0ba973086c52b415e357ad9d1978e4 | [
"MIT"
] | null | null | null | spritesheet.py | Juanpam/Pakman | 487b288bac0ba973086c52b415e357ad9d1978e4 | [
"MIT"
] | null | null | null | spritesheet.py | Juanpam/Pakman | 487b288bac0ba973086c52b415e357ad9d1978e4 | [
"MIT"
] | null | null | null | # This class handles sprite sheets
# This was taken from www.scriptefun.com/transcript-2-using
# sprite-sheets-and-drawing-the-background
# I've added some code to fail if the file wasn't found..
# Note: When calling images_at the rect is the format:
# (x, y, x + offset, y + offset)
import pygame
class spritesheet(ob... | 39.619048 | 65 | 0.638221 |
import pygame
class spritesheet(object):
def __init__(self, filename):
try:
self.sheet = pygame.image.load(filename) except (pygame.error, message):
print ('Unable to load spritesheet image:', filename)
raise (SystemExit, message)
def image_at(self, recta... | true | true |
08efc368d12f66d2f49f1913998155bab931082a | 2,917 | py | Python | huaweicloud-sdk-ocr/huaweicloudsdkocr/v1/model/recognize_flight_itinerary_response.py | githubmilesma/huaweicloud-sdk-python-v3 | 9d9449ed68a609ca65f0aa50b5b2a1c28445bf03 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:59:28.000Z | 2021-04-16T07:59:28.000Z | huaweicloud-sdk-ocr/huaweicloudsdkocr/v1/model/recognize_flight_itinerary_response.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-ocr/huaweicloudsdkocr/v1/model/recognize_flight_itinerary_response.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | 1 | 2022-01-17T02:24:18.000Z | 2022-01-17T02:24:18.000Z | # coding: utf-8
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class RecognizeFlightItineraryResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribu... | 26.761468 | 83 | 0.561536 |
import pprint
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
class RecognizeFlightItineraryResponse(SdkResponse):
sensitive_list = []
openapi_types = {
'result': 'FlightItineraryResult'
}
attribute_map = {
'result': 'result'
}
def __init_... | true | true |
08efc391308481d79b31814a2929f9d4a0b3805a | 1,957 | py | Python | python/heterocl/tvm/_ffi/_ctypes/node.py | hj424/heterocl | e51b8f7f65ae6ad55c0c2426ab7192c3d8f6702b | [
"Apache-2.0"
] | 236 | 2019-05-19T01:48:11.000Z | 2022-03-31T09:03:54.000Z | python/heterocl/tvm/_ffi/_ctypes/node.py | hj424/heterocl | e51b8f7f65ae6ad55c0c2426ab7192c3d8f6702b | [
"Apache-2.0"
] | 248 | 2019-05-17T19:18:36.000Z | 2022-03-30T21:25:47.000Z | python/heterocl/tvm/_ffi/_ctypes/node.py | hj424/heterocl | e51b8f7f65ae6ad55c0c2426ab7192c3d8f6702b | [
"Apache-2.0"
] | 85 | 2019-05-17T20:09:27.000Z | 2022-02-28T20:19:00.000Z | # pylint: disable=invalid-name, protected-access
# pylint: disable=no-member, missing-docstring
from __future__ import absolute_import
import ctypes
from ..base import _LIB, check_call, c_str
from ..node_generic import _set_class_node_base
from .types import TVMValue, TypeCode
from .types import RETURN_SWITCH, C_TO_PY... | 30.578125 | 78 | 0.678079 | from __future__ import absolute_import
import ctypes
from ..base import _LIB, check_call, c_str
from ..node_generic import _set_class_node_base
from .types import TVMValue, TypeCode
from .types import RETURN_SWITCH, C_TO_PY_ARG_SWITCH, _wrap_arg_func
NodeHandle = ctypes.c_void_p
NODE_TYPE = {}
def _register_node(in... | true | true |
08efc47f7becc0b3a608696af90662ceb13fbc03 | 3,967 | py | Python | src/pretix/base/services/tasks.py | gnomus/pretix | 9a9ae3e7807c5fce12adeabf5e2bb81e6b32fb38 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-04-25T00:11:00.000Z | 2020-04-25T00:11:00.000Z | src/pretix/base/services/tasks.py | gnomus/pretix | 9a9ae3e7807c5fce12adeabf5e2bb81e6b32fb38 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-06-12T00:09:40.000Z | 2020-06-12T00:09:40.000Z | src/pretix/base/services/tasks.py | gnomus/pretix | 9a9ae3e7807c5fce12adeabf5e2bb81e6b32fb38 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | """
This code has been taken from
https://blog.hypertrack.io/2016/10/08/dealing-with-database-transactions-in-django-celery/
Usage:
from pretix.base.services.async import TransactionAwareTask
@task(base=TransactionAwareTask)
def task_…():
"""
import cProfile
import os
import random
import time
from django... | 32.785124 | 118 | 0.62793 | import cProfile
import os
import random
import time
from django.conf import settings
from django.db import transaction
from django_scopes import scope, scopes_disabled
from pretix.base.metrics import (
pretix_task_duration_seconds, pretix_task_runs_total,
)
from pretix.base.models import Event
from pretix.celery_... | true | true |
08efc6b2fa775a37e96987917fc31fbf3254dbe1 | 413 | py | Python | scripts/simple-tcp-proxy.py | jamjven/ATX | 09571aa2745fc9c3583b17c466869db5b86bf5f5 | [
"Apache-2.0"
] | 1,132 | 2017-07-21T05:08:56.000Z | 2022-03-23T01:29:00.000Z | scripts/simple-tcp-proxy.py | jamjven/ATX | 09571aa2745fc9c3583b17c466869db5b86bf5f5 | [
"Apache-2.0"
] | 74 | 2017-07-21T06:00:32.000Z | 2019-01-25T05:10:20.000Z | scripts/simple-tcp-proxy.py | jamjven/ATX | 09571aa2745fc9c3583b17c466869db5b86bf5f5 | [
"Apache-2.0"
] | 277 | 2017-07-28T07:23:54.000Z | 2022-03-22T08:39:08.000Z | #!/usr/bin/env python
import tornado.ioloop
import maproxy.proxyserver
import socket
# HTTP->HTTP: On your computer, browse to "http://127.0.0.1:81/" and you'll get http://www.google.com
server = maproxy.proxyserver.ProxyServer("127.0.0.1", 26944)
server.listen(5555)
print("Local IP:", socket.gethostbyname(socket.geth... | 37.545455 | 101 | 0.738499 | import tornado.ioloop
import maproxy.proxyserver
import socket
server = maproxy.proxyserver.ProxyServer("127.0.0.1", 26944)
server.listen(5555)
print("Local IP:", socket.gethostbyname(socket.gethostname()))
print("0.0.0.0:5555 -> 127.0.0.1:26944")
tornado.ioloop.IOLoop.instance().start() | true | true |
08efc7ab58814d74ccb75431ff18558a92b1d3c5 | 2,595 | py | Python | pwnlib/util/splash.py | alexpark07/pwntools | c86022e844c8264ba4c35ed1dd5d55f1c76be90b | [
"MIT"
] | 1 | 2015-04-21T11:30:28.000Z | 2015-04-21T11:30:28.000Z | pwnlib/util/splash.py | alexpark07/pwntools | c86022e844c8264ba4c35ed1dd5d55f1c76be90b | [
"MIT"
] | null | null | null | pwnlib/util/splash.py | alexpark07/pwntools | c86022e844c8264ba4c35ed1dd5d55f1c76be90b | [
"MIT"
] | null | null | null | """Silly module mostly meant as an easter-egg."""
from .. import term, log
from ..term import text
import time, threading
_banner = r'''
.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:.
) _____ _ _ )
( | _ |___ _ _ _ ___ ___ _... | 38.161765 | 76 | 0.336416 |
from .. import term, log
from ..term import text
import time, threading
_banner = r'''
.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:._.:*~*:.
) _____ _ _ )
( | _ |___ _ _ _ ___ ___ ___ _| | | |_ _ _ (
) | ... | true | true |
08efc8cc505edb34add6b909b4866f49442bc836 | 6,600 | py | Python | bin/utils/create_module.py | aiforrural/Digital-Events-Example | 628aaa8727b259b9367ac0ae1c5ba8e9e95eca82 | [
"MIT"
] | 1 | 2021-02-08T09:34:27.000Z | 2021-02-08T09:34:27.000Z | bin/utils/create_module.py | pamirk/indico | c3b4e06b11cc21ad497f74d0b2ca901bc1b2a768 | [
"MIT"
] | null | null | null | bin/utils/create_module.py | pamirk/indico | c3b4e06b11cc21ad497f74d0b2ca901bc1b2a768 | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
import os
import re
import textwrap
from collections import defaultdict
from datetime import date
import ... | 38.372093 | 117 | 0.627576 |
import os
import re
import textwrap
from collections import defaultdict
from datetime import date
import click
click.disable_unicode_literals_warning = True
def _validate_indico_dir(ctx, param, value):
if not os.path.isdir(value):
raise click.BadParameter('directory does not exist')
if not os.path... | true | true |
08efc99f1ffc954fb88d79ef3e34b422c1430efd | 1,473 | py | Python | python/pygimli/testing/test_FEM.py | sathyanarayanrao/gimli | 96eda5a99ba642a75801bd359b6ae746c2955d0b | [
"Apache-2.0"
] | null | null | null | python/pygimli/testing/test_FEM.py | sathyanarayanrao/gimli | 96eda5a99ba642a75801bd359b6ae746c2955d0b | [
"Apache-2.0"
] | null | null | null | python/pygimli/testing/test_FEM.py | sathyanarayanrao/gimli | 96eda5a99ba642a75801bd359b6ae746c2955d0b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# write a correct test!
import unittest
import pygimli as pg
import numpy as np
class TestFiniteElementBasics(unittest.TestCase):
def test_Neumann(self):
"""
"""
def _test_(mesh):
vTest = 0.1
u = pg.solve(mesh, a=1,
... | 31.340426 | 100 | 0.528174 |
import unittest
import pygimli as pg
import numpy as np
class TestFiniteElementBasics(unittest.TestCase):
def test_Neumann(self):
def _test_(mesh):
vTest = 0.1
u = pg.solve(mesh, a=1,
bc={'Node': [mesh.findNearestNode([0.0, 0.0]), 0.],
... | true | true |
08efc9ff0b5cc711d246f13aef361329ed303098 | 480 | py | Python | Documentation/numpy/reference/generated/numpy-random-vonmises-1.py | leesavide/pythonista-docs-deprecated | 9ec3363f07e328bde0a58738a16907f11dfd06e1 | [
"Apache-2.0"
] | 16 | 2016-06-14T19:45:35.000Z | 2020-11-30T19:02:58.000Z | Documentation/numpy/reference/generated/numpy-random-vonmises-1.py | leesavide/pythonista-docs | 9ec3363f07e328bde0a58738a16907f11dfd06e1 | [
"Apache-2.0"
] | 1 | 2016-06-15T07:10:27.000Z | 2016-06-15T07:10:27.000Z | Documentation/numpy/reference/generated/numpy-random-vonmises-1.py | leesavide/pythonista-docs | 9ec3363f07e328bde0a58738a16907f11dfd06e1 | [
"Apache-2.0"
] | null | null | null | # Draw samples from the distribution:
mu, kappa = 0.0, 4.0 # mean and dispersion
s = np.random.vonmises(mu, kappa, 1000)
# Display the histogram of the samples, along with
# the probability density function:
import matplotlib.pyplot as plt
import scipy.special as sps
count, bins, ignored = plt.hist(s, 50, normed=Tru... | 30 | 57 | 0.7 |
mu, kappa = 0.0, 4.0 s = np.random.vonmises(mu, kappa, 1000)
import matplotlib.pyplot as plt
import scipy.special as sps
count, bins, ignored = plt.hist(s, 50, normed=True)
x = np.arange(-np.pi, np.pi, 2*np.pi/50.)
y = -np.exp(kappa*np.cos(x-mu))/(2*np.pi*sps.jn(0,kappa))
plt.plot(x, y/max(y), linewidth=2, color='r'... | true | true |
08efca6eaec16738cc3c5a06c1251459255527dc | 6,702 | py | Python | scipy/linalg/blas.py | FRidh/scipy | dabfb4586e0b656b5f6da8b301643b918259e61f | [
"BSD-3-Clause"
] | 39 | 2016-11-08T11:24:30.000Z | 2021-11-18T06:50:21.000Z | scipy/linalg/blas.py | FRidh/scipy | dabfb4586e0b656b5f6da8b301643b918259e61f | [
"BSD-3-Clause"
] | 1 | 2015-09-30T05:26:54.000Z | 2016-03-22T15:09:56.000Z | scipy/linalg/blas.py | FRidh/scipy | dabfb4586e0b656b5f6da8b301643b918259e61f | [
"BSD-3-Clause"
] | 13 | 2017-04-08T08:03:12.000Z | 2021-08-25T08:38:52.000Z | """
Low-level BLAS functions
========================
This module contains low-level functions from the BLAS library.
.. versionadded:: 0.12.0
.. warning::
These functions do little to no error checking.
It is possible to cause crashes by mis-using them,
so prefer using the higher-level routines in `scipy.... | 21.75974 | 76 | 0.610266 |
from __future__ import division, print_function, absolute_import
__all__ = ['get_blas_funcs', 'find_best_blas_type']
import numpy as _np
from scipy.linalg import _fblas
try:
from scipy.linalg import _cblas
except ImportError:
_cblas = None
empty_module = None
from scipy.linalg._fblas import *
del empty_mod... | true | true |
08efcad561a0f52921c4b54da2bcf7a0e32eb5fa | 2,044 | py | Python | common/src/plugin_result.py | krisshol/bach-kmno | f40d85b3397bb340e26a671c54d4a753dbbb0d43 | [
"Apache-2.0"
] | 248 | 2015-01-08T09:36:44.000Z | 2022-01-12T10:29:21.000Z | common/src/plugin_result.py | krisshol/bach-kmno | f40d85b3397bb340e26a671c54d4a753dbbb0d43 | [
"Apache-2.0"
] | 50 | 2015-01-09T08:31:57.000Z | 2022-03-30T10:41:13.000Z | common/src/plugin_result.py | krisshol/bach-kmno | f40d85b3397bb340e26a671c54d4a753dbbb0d43 | [
"Apache-2.0"
] | 74 | 2015-01-05T09:11:21.000Z | 2022-03-29T02:16:54.000Z | #
# Copyright (c) 2013-2018 Quarkslab.
# This file is part of IRMA project.
#
# 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 in the top-level directory
# of this distribution and at:
#
# http:... | 33.508197 | 78 | 0.633562 |
import sys
class PluginResult(dict):
def __getattr__(self, key):
return self.get(key, None)
__setattr__ = dict.__setitem__
__delattr__ = dict.__delitem__
def __init__(self, **kwargs):
self.name = kwargs.pop('name', None)
self.type = kwargs.pop('type', None)
s... | true | true |
08efcb7e9cae2c82f9dd97062cbae80e2da7039c | 7,977 | py | Python | coupledlogistic/coupledlogistic.py | artvalencio/coupledlogistic | 15015329c808e5faf606b350d8577e05a1c1b302 | [
"Unlicense"
] | null | null | null | coupledlogistic/coupledlogistic.py | artvalencio/coupledlogistic | 15015329c808e5faf606b350d8577e05a1c1b302 | [
"Unlicense"
] | null | null | null | coupledlogistic/coupledlogistic.py | artvalencio/coupledlogistic | 15015329c808e5faf606b350d8577e05a1c1b302 | [
"Unlicense"
] | null | null | null | def coupledlogistic(tslength,r,A,sigma,couplingtype,verbose=False):
'''Generates time-series dynamics for coupled logistic networks of parameter r
--------------------------------
Inputs:
tslength: length of the time-series (number of points)
r: logistic map free parameter. Can be... | 39.102941 | 103 | 0.415194 | def coupledlogistic(tslength,r,A,sigma,couplingtype,verbose=False):
import numpy as np
import pandas as pd
A=np.array(A)
tslength=int(tslength)
if verbose==True:
print('Generating time-series')
nonodes=len(A[1,:])
if type(r)==int or type(r)==float:
r=np.ones... | true | true |
08efccac75091b70597105c5c1f9b66ea53a9402 | 427 | py | Python | backend/shooting_games_offl_28792/wsgi.py | crowdbotics-apps/shooting-games-offl-28792 | 8d69cb3fbd37228489dbc0587bbf4e793c2b31e3 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/shooting_games_offl_28792/wsgi.py | crowdbotics-apps/shooting-games-offl-28792 | 8d69cb3fbd37228489dbc0587bbf4e793c2b31e3 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/shooting_games_offl_28792/wsgi.py | crowdbotics-apps/shooting-games-offl-28792 | 8d69cb3fbd37228489dbc0587bbf4e793c2b31e3 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
WSGI config for shooting_games_offl_28792 project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdef... | 25.117647 | 85 | 0.803279 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'shooting_games_offl_28792.settings')
application = get_wsgi_application()
| true | true |
08efccd917b41b4c1231ed889b4c77773208fe04 | 3,952 | py | Python | upho/phonon/band_structure.py | sheikhahnaf/upho | c658538093d471eb20accc4028406034cb223ecc | [
"MIT"
] | null | null | null | upho/phonon/band_structure.py | sheikhahnaf/upho | c658538093d471eb20accc4028406034cb223ecc | [
"MIT"
] | null | null | null | upho/phonon/band_structure.py | sheikhahnaf/upho | c658538093d471eb20accc4028406034cb223ecc | [
"MIT"
] | 1 | 2021-04-26T14:00:31.000Z | 2021-04-26T14:00:31.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import h5py
import numpy as np
from phonopy.units import VaspToTHz
from phonopy.structure.cells import get_primitive
from upho.phonon.eigenstates import Eigenstates
... | 32.661157 | 76 | 0.615638 | from __future__ import (absolute_import, division,
print_function, unicode_literals)
import h5py
import numpy as np
from phonopy.units import VaspToTHz
from phonopy.structure.cells import get_primitive
from upho.phonon.eigenstates import Eigenstates
__author__ = 'Yuji Ikeda'
class BandStructu... | true | true |
08efcd84312317c2796dac7739b42cf643a5644b | 10,325 | py | Python | vframe_cli/vframe/image/processors/utils/yolov5_utils.py | ngi-nix/vframe | 60469e25203136f9d6a5ecaabe2423695ee9a0f2 | [
"MIT"
] | null | null | null | vframe_cli/vframe/image/processors/utils/yolov5_utils.py | ngi-nix/vframe | 60469e25203136f9d6a5ecaabe2423695ee9a0f2 | [
"MIT"
] | null | null | null | vframe_cli/vframe/image/processors/utils/yolov5_utils.py | ngi-nix/vframe | 60469e25203136f9d6a5ecaabe2423695ee9a0f2 | [
"MIT"
] | null | null | null | # code by Glenn Jocher from: https://github.com/ultralytics/yolov5
#############################################################################
#
# GNU GENERAL PUBLIC LICENSE
# Version 3, 29 June 2007
#
# Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
# ... | 40.972222 | 116 | 0.558644 |
import time
import math
import numpy as np
import torch
import cv2
def letterbox(img, new_shape=(640, 640), color=(114, 114, 114), auto=True, scaleFill=False, scaleup=True):
shape = img.shape[:2] if isinstance(new_shape, int):
new_shape = (new_shape, new_shape)
r = min(new_shape[0] / s... | true | true |
08efcdd0bef5d60c49200d6cf6727736ec1a28f4 | 1,459 | py | Python | tests/integration/test_main.py | mgcth/signal-interpreter-server | a45f0e83b75d736fbf5284403845021991124d4a | [
"MIT"
] | null | null | null | tests/integration/test_main.py | mgcth/signal-interpreter-server | a45f0e83b75d736fbf5284403845021991124d4a | [
"MIT"
] | 1 | 2021-01-23T23:11:38.000Z | 2021-01-23T23:11:38.000Z | tests/integration/test_main.py | mgcth/signal-interpreter-server | a45f0e83b75d736fbf5284403845021991124d4a | [
"MIT"
] | null | null | null | """
Integration test for main.
"""
# pylint: disable=missing-function-docstring
import sys
import os
from unittest.mock import patch
import pytest
from flask import Flask
from signal_interpreter_server.main import main
from signal_interpreter_server.routes import signal_interpreter_app
CURR_DIR = os.path.abspath(os... | 35.585366 | 117 | 0.706648 | import sys
import os
from unittest.mock import patch
import pytest
from flask import Flask
from signal_interpreter_server.main import main
from signal_interpreter_server.routes import signal_interpreter_app
CURR_DIR = os.path.abspath(os.path.dirname(__file__))
@pytest.mark.parametrize("file, services_index, id_in... | true | true |
08efcec0ebff6c1c83991e574bd0795f7c4647be | 1,830 | py | Python | test/test_get_transaction_details_by_transaction_idribsd.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | 5 | 2021-05-17T04:45:03.000Z | 2022-03-23T12:51:46.000Z | test/test_get_transaction_details_by_transaction_idribsd.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | null | null | null | test/test_get_transaction_details_by_transaction_idribsd.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | 2 | 2021-06-02T07:32:26.000Z | 2022-02-12T02:36:23.000Z | """
CryptoAPIs
Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of thei... | 44.634146 | 484 | 0.814208 |
import sys
import unittest
import cryptoapis
from cryptoapis.model.get_transaction_details_by_transaction_idribsd_vin import GetTransactionDetailsByTransactionIDRIBSDVin
from cryptoapis.model.get_transaction_details_by_transaction_idribsd_vout import GetTransactionDetailsByTransactionIDRIBSDVout
globals()['GetTransa... | true | true |
08efcf1c6198ff7f0fe29167045693e762bdbc78 | 2,292 | py | Python | venv/share/doc/networkx-2.6.3/examples/subclass/plot_printgraph.py | AisahAlfiyatusR/Image_Retrieval_Heroku | 5db06ebe95926810601a563ebf45d6f5b2cfc89f | [
"Apache-2.0"
] | 10,024 | 2015-01-01T13:06:43.000Z | 2022-03-31T12:45:25.000Z | venv/share/doc/networkx-2.6.3/examples/subclass/plot_printgraph.py | AisahAlfiyatusR/Image_Retrieval_Heroku | 5db06ebe95926810601a563ebf45d6f5b2cfc89f | [
"Apache-2.0"
] | 3,191 | 2015-01-01T18:13:11.000Z | 2022-03-31T22:06:00.000Z | venv/share/doc/networkx-2.6.3/examples/subclass/plot_printgraph.py | AisahAlfiyatusR/Image_Retrieval_Heroku | 5db06ebe95926810601a563ebf45d6f5b2cfc89f | [
"Apache-2.0"
] | 3,272 | 2015-01-01T05:04:53.000Z | 2022-03-31T17:46:35.000Z | """
===========
Print Graph
===========
Example subclass of the Graph class.
"""
import matplotlib.pyplot as plt
import networkx as nx
from networkx import Graph
class PrintGraph(Graph):
"""
Example subclass of the Graph class.
Prints activity log to file or standard output.
"""
def __init__(s... | 25.752809 | 67 | 0.594241 |
import matplotlib.pyplot as plt
import networkx as nx
from networkx import Graph
class PrintGraph(Graph):
def __init__(self, data=None, name="", file=None, **attr):
super().__init__(data=data, name=name, **attr)
if file is None:
import sys
self.fh = sys.stdout
el... | true | true |
08efd0644d5fe0e3e727ffb870e4c439b093a7bc | 1,073 | py | Python | alipay/aop/api/response/AlipayCommerceIotAdvertiserDeviceConsultResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayCommerceIotAdvertiserDeviceConsultResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayCommerceIotAdvertiserDeviceConsultResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.DeviceRelationData import DeviceRelationData
class AlipayCommerceIotAdvertiserDeviceConsultResponse(AlipayResponse):
def __init__(self):
super(AlipayComm... | 32.515152 | 121 | 0.679404 | import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
from alipay.aop.api.domain.DeviceRelationData import DeviceRelationData
class AlipayCommerceIotAdvertiserDeviceConsultResponse(AlipayResponse):
def __init__(self):
super(AlipayCommerceIotAdvertiserDeviceConsultResponse, self).... | true | true |
08efd0ba08a1a0ae05b5733cc2b12fcc22b2868e | 261 | py | Python | star_17.py | onesk/aoc2017 | 43594116e3ac94fb37655bcda9cd462a8d70dd04 | [
"MIT"
] | null | null | null | star_17.py | onesk/aoc2017 | 43594116e3ac94fb37655bcda9cd462a8d70dd04 | [
"MIT"
] | null | null | null | star_17.py | onesk/aoc2017 | 43594116e3ac94fb37655bcda9cd462a8d70dd04 | [
"MIT"
] | 1 | 2018-03-02T08:50:38.000Z | 2018-03-02T08:50:38.000Z | n, s = 2017, 366
c, d = 0, [0]
for v in xrange(1, n+1):
c = (c + s) % len(d) + 1
d = d[:c] + [v] + d[c:]
print d[c:c+2]
n = 50*1000*1000
c = 0
last = None
for v in xrange(1, n+1):
c = (c + s) % v + 1
if c == 1:
last = v
print last
| 12.428571 | 28 | 0.421456 | n, s = 2017, 366
c, d = 0, [0]
for v in xrange(1, n+1):
c = (c + s) % len(d) + 1
d = d[:c] + [v] + d[c:]
print d[c:c+2]
n = 50*1000*1000
c = 0
last = None
for v in xrange(1, n+1):
c = (c + s) % v + 1
if c == 1:
last = v
print last
| false | true |
08efd0ed0be71c02b70643676df7d8ca38f2604f | 36,756 | py | Python | catamidb/tests.py | catami/catami | e3ba30a76c7b0e1f75a758436c383b61fcb5f9b6 | [
"Zlib"
] | 1 | 2021-04-08T22:35:19.000Z | 2021-04-08T22:35:19.000Z | catamidb/tests.py | catami/catami | e3ba30a76c7b0e1f75a758436c383b61fcb5f9b6 | [
"Zlib"
] | null | null | null | catamidb/tests.py | catami/catami | e3ba30a76c7b0e1f75a758436c383b61fcb5f9b6 | [
"Zlib"
] | null | null | null | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.contrib.admin import AdminSite
from django.contrib.auth.models import User, Group
from django.forms import ModelForm
from dj... | 39.86551 | 154 | 0.578599 | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.contrib.admin import AdminSite
from django.contrib.auth.models import User, Group
from django.forms import ModelForm
from dj... | false | true |
08efd296a370276f8828e4ab27824679ddeacfe4 | 10,133 | py | Python | src/preprocess_stance.py | rasleh/StanceVeracityDetector | a882ffe73745299fd60bc200ba057f5ee5890946 | [
"MIT"
] | null | null | null | src/preprocess_stance.py | rasleh/StanceVeracityDetector | a882ffe73745299fd60bc200ba057f5ee5890946 | [
"MIT"
] | null | null | null | src/preprocess_stance.py | rasleh/StanceVeracityDetector | a882ffe73745299fd60bc200ba057f5ee5890946 | [
"MIT"
] | null | null | null | import argparse
import csv
import os
import re
import sys
from pathlib import Path
from src import data_loader
from src.dataset_classes.DAST_datasets import DastDataset
from src.dataset_classes.datasets import DataSet
from src.feature_extraction.feature_extractor import FeatureExtractor
punctuation = re.compile('[^a-... | 50.919598 | 121 | 0.707096 | import argparse
import csv
import os
import re
import sys
from pathlib import Path
from src import data_loader
from src.dataset_classes.DAST_datasets import DastDataset
from src.dataset_classes.datasets import DataSet
from src.feature_extraction.feature_extractor import FeatureExtractor
punctuation = re.compile('[^a-... | true | true |
08efd38ff1efd6e3fb55152da43cc54ca21bc176 | 33,367 | py | Python | beetsplug/lyrics.py | Ubiquitine/beets | eab4372a58f737ba68da87a4c7b5c1a8f055ecf1 | [
"MIT"
] | 1 | 2021-08-17T19:29:39.000Z | 2021-08-17T19:29:39.000Z | beetsplug/lyrics.py | AdrianaMusic/beets | f067180c4c6a8cac441da46f0e8af13a80dda368 | [
"MIT"
] | null | null | null | beetsplug/lyrics.py | AdrianaMusic/beets | f067180c4c6a8cac441da46f0e8af13a80dda368 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation t... | 35.421444 | 79 | 0.568646 |
from __future__ import absolute_import, division, print_function
import difflib
import errno
import itertools
import json
import struct
import os.path
import re
import requests
import unicodedata
from unidecode import unidecode
import warnings
import six
from six.moves import urllib
try:
from bs4 import SoupStr... | true | true |
08efd403b1b89a19e0629f81fbde7d49f4400efd | 4,155 | py | Python | mayan/apps/cabinets/api_views.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 4 | 2021-09-02T00:16:30.000Z | 2021-09-09T22:25:15.000Z | mayan/apps/cabinets/api_views.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 86 | 2021-09-01T23:53:02.000Z | 2021-09-20T02:25:10.000Z | mayan/apps/cabinets/api_views.py | nattangwiwat/Mayan-EDMS-recitation | fcf16afb56eae812fb99144d65ae1ae6749de0b7 | [
"Apache-2.0"
] | 70 | 2021-09-01T12:54:51.000Z | 2022-02-16T00:53:18.000Z | from mayan.apps.documents.models.document_models import Document
from mayan.apps.documents.permissions import permission_document_view
from mayan.apps.documents.serializers.document_serializers import DocumentSerializer
from mayan.apps.rest_api import generics
from mayan.apps.rest_api.api_view_mixins import ExternalObj... | 32.716535 | 84 | 0.729001 | from mayan.apps.documents.models.document_models import Document
from mayan.apps.documents.permissions import permission_document_view
from mayan.apps.documents.serializers.document_serializers import DocumentSerializer
from mayan.apps.rest_api import generics
from mayan.apps.rest_api.api_view_mixins import ExternalObj... | true | true |
08efd430684dc74a3fd88e48e4669076cc02b283 | 5,591 | py | Python | kubernetes/utils/create_from_yaml.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | 1 | 2019-04-14T23:51:35.000Z | 2019-04-14T23:51:35.000Z | kubernetes/utils/create_from_yaml.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | null | null | null | kubernetes/utils/create_from_yaml.py | redjohn/python | 5e512ff564c244c50cab780d821542ed56aa965a | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Kubernetes Authors.
#
# 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 ... | 39.652482 | 77 | 0.639778 |
import re
from os import path
import yaml
from kubernetes import client
def create_from_yaml(
k8s_client,
yaml_file,
verbose=False,
**kwargs):
with open(path.abspath(yaml_file)) as f:
yml_document_all = yaml.safe_load_all(f)
api_exceptions = []
... | true | true |
08efd586244de919eb5617bb5a84181ddbeb1b93 | 1,116 | py | Python | 02_Arrays/max_distance.py | Sheetal0601/InterviewBit | 72ba1507278dafac6e5fb81da20d372e3d141348 | [
"MIT"
] | 61 | 2018-02-18T08:16:31.000Z | 2022-02-17T17:18:57.000Z | 02_Arrays/max_distance.py | Sheetal0601/InterviewBit | 72ba1507278dafac6e5fb81da20d372e3d141348 | [
"MIT"
] | 1 | 2018-02-23T20:06:18.000Z | 2019-12-29T18:52:20.000Z | 02_Arrays/max_distance.py | Sheetal0601/InterviewBit | 72ba1507278dafac6e5fb81da20d372e3d141348 | [
"MIT"
] | 30 | 2018-03-28T19:02:23.000Z | 2021-07-06T20:00:14.000Z | # Max Distance
# https://www.interviewbit.com/problems/max-distance/
#
# If there is no solution possible, return -1.
#
# Example:
#
# A : [3 5 4 2]
#
# Output : 2
# for the pair (3, 4)
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
class Solution:
# @param A ... | 24.8 | 99 | 0.409498 |
class Solution:
def maximumGap(self, A):
dp_min, minn = list(), float('inf')
dp_max, maxx = list(), -float('inf')
for tmp_min, tmp_max in zip(A, reversed(A)):
minn = min(minn, tmp_min)
dp_min.append(minn)
maxx = max(tmp_max, maxx)
dp... | true | true |
08efd5ee15997feafc20566e77ea58e1ba5a7b60 | 11,705 | py | Python | tasks/urls.py | Ishayahu/MJCC-tasks | 68ea00dab543e6e4e0f6cf6b6683f3719bb6f3c0 | [
"MIT"
] | 1 | 2017-09-25T09:36:46.000Z | 2017-09-25T09:36:46.000Z | tasks/urls.py | Ishayahu/MJCC-tasks | 68ea00dab543e6e4e0f6cf6b6683f3719bb6f3c0 | [
"MIT"
] | 40 | 2015-05-29T11:25:15.000Z | 2015-08-13T10:28:17.000Z | tasks/urls.py | Ishayahu/MJCC-tasks | 68ea00dab543e6e4e0f6cf6b6683f3719bb6f3c0 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# coding=<utf8>
# from django.conf.urls.defaults import patterns, include, url
from django.conf.urls import url, include
# from django.conf.urls import patterns, url, include
# from django.conf.urls.defaults import *
import todoes.views
import todoes.api
import assets.views
import save_state.ap... | 40.642361 | 70 | 0.649124 |
from django.conf.urls import url, include
import todoes.views
import todoes.api
import assets.views
import save_state.api
import snmp.api
import assets.test_view
import assets.api
import logs.views
import user_settings.views
import djlib
from django.contrib import admin
from django.contrib.auth.views import login, lo... | true | true |
08efd6196445f26b2255dd81ad33e7d220f520d0 | 72,597 | py | Python | airflow/models/dag.py | molei20021/airflow-1-10-9-mod | 0888472c8fc9e7c67ea25616d875685ff460a0f0 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/models/dag.py | molei20021/airflow-1-10-9-mod | 0888472c8fc9e7c67ea25616d875685ff460a0f0 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/models/dag.py | molei20021/airflow-1-10-9-mod | 0888472c8fc9e7c67ea25616d875685ff460a0f0 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-05-28T17:16:38.000Z | 2020-05-28T17:16:38.000Z | # -*- coding: utf-8 -*-
#
# 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
#... | 38.842697 | 109 | 0.607312 |
from __future__ import print_function
import copy
import functools
import os
import pickle
import re
import sys
import traceback
import warnings
from collections import OrderedDict, defaultdict
from datetime import timedelta, datetime
from typing import TYPE_CHECKING, Callable, Dict, FrozenSet, Iterable, List, Option... | true | true |
08efd81567e7fba1d732959ffc0a5bace899fbdd | 629 | py | Python | backend/manage.py | crowdbotics-apps/tbd-32601 | 726af824e581eeab3b2c157e7dfd307bc07861a5 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/tbd-32601 | 726af824e581eeab3b2c157e7dfd307bc07861a5 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/tbd-32601 | 726af824e581eeab3b2c157e7dfd307bc07861a5 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tbd_32601.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Impo... | 28.590909 | 73 | 0.683625 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tbd_32601.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
08efd8246ca0b266713e035aab80037060783204 | 40,781 | py | Python | emat/analysis/explore_2/explore_visualizer.py | jinsanity07git/tmip-emat | ff816cf50f141825078bb276d6da46d92c5028a9 | [
"BSD-3-Clause"
] | null | null | null | emat/analysis/explore_2/explore_visualizer.py | jinsanity07git/tmip-emat | ff816cf50f141825078bb276d6da46d92c5028a9 | [
"BSD-3-Clause"
] | null | null | null | emat/analysis/explore_2/explore_visualizer.py | jinsanity07git/tmip-emat | ff816cf50f141825078bb276d6da46d92c5028a9 | [
"BSD-3-Clause"
] | null | null | null | import numpy
import pandas
import warnings
import functools
from ...viz import colors
from ...scope.box import GenericBox
from ...database import Database
from traitlets import TraitError
from plotly import graph_objs as go
from ipywidgets import Dropdown
import ipywidgets as widget
import logging
_logger = logging.... | 28.739253 | 109 | 0.688237 | import numpy
import pandas
import warnings
import functools
from ...viz import colors
from ...scope.box import GenericBox
from ...database import Database
from traitlets import TraitError
from plotly import graph_objs as go
from ipywidgets import Dropdown
import ipywidgets as widget
import logging
_logger = logging.... | true | true |
08efd8f9786a41ae059d1e6129ebd1239b0cb42e | 619 | py | Python | apphv/mainUser/migrations/0028_auto_20190624_1815.py | FerneyMoreno20/Portfolio | 59eaa4f4f6762386fe84450f65f508be1414f857 | [
"bzip2-1.0.6"
] | null | null | null | apphv/mainUser/migrations/0028_auto_20190624_1815.py | FerneyMoreno20/Portfolio | 59eaa4f4f6762386fe84450f65f508be1414f857 | [
"bzip2-1.0.6"
] | 6 | 2019-12-04T23:34:47.000Z | 2021-06-09T18:01:16.000Z | apphv/mainUser/migrations/0028_auto_20190624_1815.py | FerneyMoreno20/Portfolio | 59eaa4f4f6762386fe84450f65f508be1414f857 | [
"bzip2-1.0.6"
] | null | null | null | # Generated by Django 2.2.2 on 2019-06-24 18:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mainUser', '0027_auto_20190624_1705'),
]
operations = [
migrations.AlterField(
model_name='educacion',
name='FechGra... | 25.791667 | 85 | 0.605816 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mainUser', '0027_auto_20190624_1705'),
]
operations = [
migrations.AlterField(
model_name='educacion',
name='FechGrado',
field=models.DateField(null=Tru... | true | true |
08efd91667a0df0d5d5af1a904207e863e25a4d3 | 1,275 | py | Python | demo/tests/test_forms_login.py | prafullkotecha/django-material | a81641634893db132d17a4b355b66c3e12bceeff | [
"BSD-3-Clause"
] | null | null | null | demo/tests/test_forms_login.py | prafullkotecha/django-material | a81641634893db132d17a4b355b66c3e12bceeff | [
"BSD-3-Clause"
] | null | null | null | demo/tests/test_forms_login.py | prafullkotecha/django-material | a81641634893db132d17a4b355b66c3e12bceeff | [
"BSD-3-Clause"
] | 1 | 2021-11-04T15:25:11.000Z | 2021-11-04T15:25:11.000Z | from django.conf.urls import url
from django.views import generic
from django.test.utils import override_settings
from django_webtest import WebTest
from .. import forms
@override_settings(ROOT_URLCONF=__name__)
class Test(WebTest):
def test_default_usecase(self):
page = self.app.get('/demo/login/')
... | 31.875 | 113 | 0.658824 | from django.conf.urls import url
from django.views import generic
from django.test.utils import override_settings
from django_webtest import WebTest
from .. import forms
@override_settings(ROOT_URLCONF=__name__)
class Test(WebTest):
def test_default_usecase(self):
page = self.app.get('/demo/login/')
... | true | true |
08efd95d2d24b821eecbb6279ce35944b49c68a2 | 3,222 | py | Python | test/acceptance/common_steps/paas_environment_provisioning.py | FIWARE/cloud.PaaS | 3ddec91c2b0ef3baca1dd2e596373cf0d4d341e3 | [
"Apache-2.0"
] | null | null | null | test/acceptance/common_steps/paas_environment_provisioning.py | FIWARE/cloud.PaaS | 3ddec91c2b0ef3baca1dd2e596373cf0d4d341e3 | [
"Apache-2.0"
] | null | null | null | test/acceptance/common_steps/paas_environment_provisioning.py | FIWARE/cloud.PaaS | 3ddec91c2b0ef3baca1dd2e596373cf0d4d341e3 | [
"Apache-2.0"
] | 2 | 2016-08-22T16:03:25.000Z | 2018-03-05T23:28:55.000Z | # -*- coding: utf-8 -*-
# Copyright 2014 Telefonica Investigación y Desarrollo, S.A.U
#
# This file is part of FI-WARE project.
#
# 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:
#
# h... | 38.819277 | 120 | 0.72843 |
__author__ = 'jfernandez'
from lettuce import world
from lettuce_tools.dataset_utils.dataset_utils import DatasetUtils
from tools.tier import Tier
from tools.constants import NAME, PAAS, TIER_IMAGE, PRODUCTS, NETWORKS, TIER_REQUEST_REGION, TIER_REQUEST_IMAGE
dataset_utils = DatasetUtils()
def process_following_in... | true | true |
08efdb9ee0a94cb6342ba6e1f6a41b52e0a44bdf | 1,302 | py | Python | src/RepairManager/utils/email.py | RichardZhaoW/DLWorkspace | 27d3a3a82e59305bdc67dbfd69098d493f8b3cd5 | [
"MIT"
] | 38 | 2020-07-13T08:46:39.000Z | 2021-02-08T01:38:44.000Z | src/RepairManager/utils/email.py | RichardZhaoW/DLWorkspace | 27d3a3a82e59305bdc67dbfd69098d493f8b3cd5 | [
"MIT"
] | null | null | null | src/RepairManager/utils/email.py | RichardZhaoW/DLWorkspace | 27d3a3a82e59305bdc67dbfd69098d493f8b3cd5 | [
"MIT"
] | 20 | 2020-07-14T03:38:50.000Z | 2021-01-08T06:24:17.000Z | import smtplib
import logging
import yaml
import datetime
class EmailHandler():
def __init__(self):
self.config=self.load_config()
def load_config(self):
with open('./config/email-config.yaml', 'r') as file:
return yaml.safe_load(file)
def send(self, subject, body):
r... | 34.263158 | 88 | 0.592166 | import smtplib
import logging
import yaml
import datetime
class EmailHandler():
def __init__(self):
self.config=self.load_config()
def load_config(self):
with open('./config/email-config.yaml', 'r') as file:
return yaml.safe_load(file)
def send(self, subject, body):
r... | true | true |
08efdc1490ab2dbec71e860541df4b89cd9b3705 | 15,790 | py | Python | utils/vis_tools/helpers.py | shinya7y/gangealing | 6e6897640145544496c3115bf3f5b6209c89c7a0 | [
"BSD-2-Clause"
] | 2 | 2021-12-10T03:15:53.000Z | 2021-12-10T03:15:56.000Z | utils/vis_tools/helpers.py | guoyang-xie/gangealing | 353e059d322105dbc0389409b3579772c0673839 | [
"BSD-2-Clause"
] | null | null | null | utils/vis_tools/helpers.py | guoyang-xie/gangealing | 353e059d322105dbc0389409b3579772c0673839 | [
"BSD-2-Clause"
] | null | null | null | import torch
from torchvision.utils import make_grid, save_image
import numpy as np
from PIL import Image, ImageColor
import moviepy.editor
import plotly.graph_objects as go
import plotly.colors
from utils.splat2d_cuda import splat2d
from tqdm import tqdm
import ray
import os
# These are the colorscales for visualizin... | 46.441176 | 167 | 0.648955 | import torch
from torchvision.utils import make_grid, save_image
import numpy as np
from PIL import Image, ImageColor
import moviepy.editor
import plotly.graph_objects as go
import plotly.colors
from utils.splat2d_cuda import splat2d
from tqdm import tqdm
import ray
import os
CLUSTER_COLORSCALES = ['plasma', 'plotly3'... | true | true |
08efdcd40d44d4e959b6aec8898526bc59d87891 | 725 | py | Python | find_best_seat_in_theater.py | v2thegreat/a-mathematical-function-to-find-the-best-seat-in-a-movie-theater | 8fa2a5b2b4097127bc23a1b40fb5051f9fbf791f | [
"MIT"
] | 2 | 2018-07-08T14:44:11.000Z | 2018-07-09T03:02:54.000Z | find_best_seat_in_theater.py | v2thegreat/a-mathematical-function-to-find-the-best-seat-in-a-movie-theater | 8fa2a5b2b4097127bc23a1b40fb5051f9fbf791f | [
"MIT"
] | null | null | null | find_best_seat_in_theater.py | v2thegreat/a-mathematical-function-to-find-the-best-seat-in-a-movie-theater | 8fa2a5b2b4097127bc23a1b40fb5051f9fbf791f | [
"MIT"
] | null | null | null | from math import cos, sin, ceil
peripheral_view = 114
def find_best_seat(width_of_screen, distance_between_screen_and_first_row):
distance_from_screen = cot(peripheral_view) * width_of_screen/2
best_possible_seat = (distance_from_screen -
distance_between_screen_and_first_row)
... | 23.387097 | 75 | 0.710345 | from math import cos, sin, ceil
peripheral_view = 114
def find_best_seat(width_of_screen, distance_between_screen_and_first_row):
distance_from_screen = cot(peripheral_view) * width_of_screen/2
best_possible_seat = (distance_from_screen -
distance_between_screen_and_first_row)
... | true | true |
08efdd1a2631557a5e933bd90d01dd200b4558ea | 777 | py | Python | setup.py | Matmaus/LnkParse | c515153b0fb53c65aca663893b8660edaaaf5cce | [
"MIT"
] | 6 | 2019-04-16T10:19:15.000Z | 2022-03-18T22:21:18.000Z | setup.py | Matmaus/LnkParse | c515153b0fb53c65aca663893b8660edaaaf5cce | [
"MIT"
] | 12 | 2020-09-15T08:02:48.000Z | 2021-07-19T13:52:57.000Z | setup.py | Matmaus/LnkParse | c515153b0fb53c65aca663893b8660edaaaf5cce | [
"MIT"
] | 3 | 2019-10-10T06:38:48.000Z | 2020-10-25T08:24:34.000Z | from setuptools import setup
from setuptools import find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='LnkParse3',
version='1.2.0',
description='Windows Shortcut file (LNK) parser',
long_description=long_description,
long_description_content_type="text/... | 25.9 | 53 | 0.640927 | from setuptools import setup
from setuptools import find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
setup(
name='LnkParse3',
version='1.2.0',
description='Windows Shortcut file (LNK) parser',
long_description=long_description,
long_description_content_type="text/... | true | true |
08efde287780e993ee4eebbfe686c6a465e8b523 | 1,762 | py | Python | selfdrive/debug/toyota_eps_factor.py | ssmithTaylor/openpilot | ae1083d700190eb050d1da1ce88ecd53a790a61d | [
"MIT"
] | 5 | 2020-12-23T01:49:04.000Z | 2021-08-28T23:42:52.000Z | selfdrive/debug/toyota_eps_factor.py | ssmithTaylor/openpilot | ae1083d700190eb050d1da1ce88ecd53a790a61d | [
"MIT"
] | 60 | 2020-09-03T15:23:38.000Z | 2021-12-17T12:39:50.000Z | selfdrive/debug/toyota_eps_factor.py | ssmithTaylor/openpilot | ae1083d700190eb050d1da1ce88ecd53a790a61d | [
"MIT"
] | 2 | 2020-12-07T20:04:19.000Z | 2022-03-05T08:00:03.000Z | #!/usr/bin/env python3
import sys
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model # pylint: disable=import-error
from selfdrive.car.toyota.values import STEER_THRESHOLD
from tools.lib.route import Route
from tools.lib.logreader import MultiLogIterator
MIN_SAMPLES = 30 * 100
def ... | 27.53125 | 94 | 0.645289 | import sys
import numpy as np
import matplotlib.pyplot as plt
from sklearn import linear_model from selfdrive.car.toyota.values import STEER_THRESHOLD
from tools.lib.route import Route
from tools.lib.logreader import MultiLogIterator
MIN_SAMPLES = 30 * 100
def to_signed(n, bits):
if n >= (1 << max((bits - 1), 0)... | true | true |
08efdea53b5c80d98cb5b4292fdeca4b42c03875 | 5,865 | py | Python | Mighty_Browser.py | muhammad-fiaz/mightybrowser | 4be74fbb327a6d88adccf6f45546a75b74ed2ff7 | [
"MIT"
] | null | null | null | Mighty_Browser.py | muhammad-fiaz/mightybrowser | 4be74fbb327a6d88adccf6f45546a75b74ed2ff7 | [
"MIT"
] | null | null | null | Mighty_Browser.py | muhammad-fiaz/mightybrowser | 4be74fbb327a6d88adccf6f45546a75b74ed2ff7 | [
"MIT"
] | null | null | null | # importing required libraries
from PyQt5 import QtGui
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtWebEngineWidgets import *
import sys
class MainWindow(QMainWindow):
# constructor
def __init__(self, *args, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs)
# ... | 25.280172 | 75 | 0.692583 | from PyQt5 import QtGui
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5.QtWebEngineWidgets import *
import sys
class MainWindow(QMainWindow):
def __init__(self, *args, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs)
self.tabs = QTabWidget()
self.tabs.setDo... | true | true |
08efdf12b4bbb5cd5abc50da5f9bcba23ef706ae | 108 | py | Python | Math/College Algebra/42.py | Alonoparag/my-datascience-prep | c18d6b85d44631e3478c6529bdd0be5df0e0a1d1 | [
"Apache-2.0"
] | null | null | null | Math/College Algebra/42.py | Alonoparag/my-datascience-prep | c18d6b85d44631e3478c6529bdd0be5df0e0a1d1 | [
"Apache-2.0"
] | null | null | null | Math/College Algebra/42.py | Alonoparag/my-datascience-prep | c18d6b85d44631e3478c6529bdd0be5df0e0a1d1 | [
"Apache-2.0"
] | null | null | null | import fourFn
import fourFn
import numpy as np
nsp = fourFn.NumericStringParser()
expression
print(result) | 13.5 | 34 | 0.814815 | import fourFn
import fourFn
import numpy as np
nsp = fourFn.NumericStringParser()
expression
print(result) | true | true |
08efdf4a49bc9769ea2f7b62c6907993d7925b11 | 12,850 | py | Python | felix/bert_example.py | DionysisChristopoulos/google-research | 7f59ef421beef32ca16c2a7215be74f7eba01a0f | [
"Apache-2.0"
] | 23,901 | 2018-10-04T19:48:53.000Z | 2022-03-31T21:27:42.000Z | felix/bert_example.py | DionysisChristopoulos/google-research | 7f59ef421beef32ca16c2a7215be74f7eba01a0f | [
"Apache-2.0"
] | 891 | 2018-11-10T06:16:13.000Z | 2022-03-31T10:42:34.000Z | felix/bert_example.py | admariner/google-research | 7cee4b22b925581d912e8d993625c180da2a5a4f | [
"Apache-2.0"
] | 6,047 | 2018-10-12T06:31:02.000Z | 2022-03-31T13:59:28.000Z | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 36.197183 | 80 | 0.667471 |
import collections
import itertools
from typing import Mapping, MutableSequence, Optional, Sequence, Tuple
import frozendict
import tensorflow as tf
from felix import felix_constants as constants
from felix import insertion_converter
from felix import pointing_converter
from felix import tokenization
from felix imp... | true | true |
08efe019546c9ea490b8759ddf692428381f2cce | 8,730 | py | Python | sleekbot/pluginbase.py | hgrecco/SleekBot | 6690cc9f644d5b0c9f8eb6e3540eea336ed61847 | [
"MIT"
] | null | null | null | sleekbot/pluginbase.py | hgrecco/SleekBot | 6690cc9f644d5b0c9f8eb6e3540eea336ed61847 | [
"MIT"
] | null | null | null | sleekbot/pluginbase.py | hgrecco/SleekBot | 6690cc9f644d5b0c9f8eb6e3540eea336ed61847 | [
"MIT"
] | 1 | 2019-10-28T16:49:27.000Z | 2019-10-28T16:49:27.000Z | """
This file is part of SleekBot. http://github.com/hgrecco/SleekBot
See the README file for more information.
"""
__author__ = 'Hernan E. Grecco <hernan.grecco@gmail.com>'
__license__ = 'MIT License/X11 license'
import logging
import inspect
from collections import defaultdict
def call_on_register(plugin... | 33.968872 | 80 | 0.589576 |
__author__ = 'Hernan E. Grecco <hernan.grecco@gmail.com>'
__license__ = 'MIT License/X11 license'
import logging
import inspect
from collections import defaultdict
def call_on_register(plugin_name):
def __outer(wrapped):
def __inner(*args, **kwargs):
return wrapped(*args, **kwargs)
... | true | true |
08efe072205df83838b94a0d4c9f93d527e73369 | 1,384 | py | Python | tests/search_test.py | stamkracht/wikipedia-opensearch | 1a1409045c60b4b3351c734c8f3a213ecd41fd02 | [
"MIT"
] | null | null | null | tests/search_test.py | stamkracht/wikipedia-opensearch | 1a1409045c60b4b3351c734c8f3a213ecd41fd02 | [
"MIT"
] | null | null | null | tests/search_test.py | stamkracht/wikipedia-opensearch | 1a1409045c60b4b3351c734c8f3a213ecd41fd02 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
from collections import defaultdict
from wikipedia import wikipedia
from request_mock_data import mock_data
# mock out _wiki_request
class _wiki_request(object):
''' _wiki_request override '''
calls = defaultdict(int)
@classmethod
def __call__(cls, params):
cls.c... | 30.755556 | 97 | 0.724711 | import unittest
from collections import defaultdict
from wikipedia import wikipedia
from request_mock_data import mock_data
class _wiki_request(object):
calls = defaultdict(int)
@classmethod
def __call__(cls, params):
cls.calls[params.__str__()] += 1
return mock_data["_wiki_request calls"][tuple(sort... | true | true |
08efe0e3ca127b7b2016248f6e7c89d3dff924f3 | 950 | py | Python | odoo-14.0/addons/account_edi/__manifest__.py | Yomy1996/P1 | 59e24cdd5f7f82005fe15bd7a7ff54dd5364dd29 | [
"CC-BY-3.0"
] | null | null | null | odoo-14.0/addons/account_edi/__manifest__.py | Yomy1996/P1 | 59e24cdd5f7f82005fe15bd7a7ff54dd5364dd29 | [
"CC-BY-3.0"
] | null | null | null | odoo-14.0/addons/account_edi/__manifest__.py | Yomy1996/P1 | 59e24cdd5f7f82005fe15bd7a7ff54dd5364dd29 | [
"CC-BY-3.0"
] | null | null | null | # -*- coding: utf-8 -*-
{
'name' : 'Import/Export Invoices From XML/PDF',
'description':"""
Electronic Data Interchange
=======================================
EDI is the electronic interchange of business information using a standardized format.
This is the base module for import and export of invoices in var... | 32.758621 | 94 | 0.642105 | {
'name' : 'Import/Export Invoices From XML/PDF',
'description':"""
Electronic Data Interchange
=======================================
EDI is the electronic interchange of business information using a standardized format.
This is the base module for import and export of invoices in various EDI formats, and th... | true | true |
08efe0f9d07c7effde63ee269e6ffc87ba2f7e89 | 686 | py | Python | app/core/migrations/0003_ingredient.py | dcruzf/recipe-app-api | 301a2a88593d558a1a84c8f3b2b7d55bcb822ec1 | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingredient.py | dcruzf/recipe-app-api | 301a2a88593d558a1a84c8f3b2b7d55bcb822ec1 | [
"MIT"
] | null | null | null | app/core/migrations/0003_ingredient.py | dcruzf/recipe-app-api | 301a2a88593d558a1a84c8f3b2b7d55bcb822ec1 | [
"MIT"
] | null | null | null | # Generated by Django 3.2 on 2021-04-28 14:54
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(
nam... | 28.583333 | 118 | 0.619534 |
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 |
08efe11c8775417c5852fa0100fd7b875396e559 | 2,588 | py | Python | django/core/management/utils.py | MikeAmy/django | 00cb9e13b4cf06ed2be27ee9e7fc18969ae69f7d | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-07-15T05:45:02.000Z | 2020-07-15T05:45:02.000Z | django/core/management/utils.py | MikeAmy/django | 00cb9e13b4cf06ed2be27ee9e7fc18969ae69f7d | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/core/management/utils.py | MikeAmy/django | 00cb9e13b4cf06ed2be27ee9e7fc18969ae69f7d | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-09-07T23:05:44.000Z | 2020-09-07T23:05:44.000Z | from __future__ import unicode_literals
import os
import sys
from subprocess import PIPE, Popen
from django.utils import six
from django.utils.encoding import DEFAULT_LOCALE_ENCODING, force_text
from .base import CommandError
def popen_wrapper(args, os_err_exc_type=CommandError, stdout_encoding='utf-8'):
"""
... | 33.179487 | 89 | 0.628284 | from __future__ import unicode_literals
import os
import sys
from subprocess import PIPE, Popen
from django.utils import six
from django.utils.encoding import DEFAULT_LOCALE_ENCODING, force_text
from .base import CommandError
def popen_wrapper(args, os_err_exc_type=CommandError, stdout_encoding='utf-8'):
try:
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.