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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c45d8033a8532a5310eb7b5b6868e1725ae9e8a | 1,188 | py | Python | profiles_api/serializers.py | vikrantgautam/profiles-rest-api | 68abd9398f04de6eb87357b997dd438b6503f8ea | [
"MIT"
] | null | null | null | profiles_api/serializers.py | vikrantgautam/profiles-rest-api | 68abd9398f04de6eb87357b997dd438b6503f8ea | [
"MIT"
] | null | null | null | profiles_api/serializers.py | vikrantgautam/profiles-rest-api | 68abd9398f04de6eb87357b997dd438b6503f8ea | [
"MIT"
] | null | null | null | from rest_framework import serializers
from profiles_api import models
class HelloSerializer(serializers.Serializer):
"""Serializes a name field for testing our APIView"""
name = serializers.CharField(max_length=10)
class UserProfileSerializer(serializers.ModelSerializer):
"""Serializes a user profile ... | 28.285714 | 68 | 0.625421 | from rest_framework import serializers
from profiles_api import models
class HelloSerializer(serializers.Serializer):
name = serializers.CharField(max_length=10)
class UserProfileSerializer(serializers.ModelSerializer):
class Meta:
model = models.UserProfile
fields = ('id', 'email', 'name'... | true | true |
1c45d82e9f5994d25e1d89ebc33ba778c614bf38 | 1,850 | py | Python | weasyl/cron.py | theSeracen/weasyl | c13b4f61f559ce44bfaee027ffc59a1379d25f3e | [
"Apache-2.0"
] | null | null | null | weasyl/cron.py | theSeracen/weasyl | c13b4f61f559ce44bfaee027ffc59a1379d25f3e | [
"Apache-2.0"
] | 148 | 2021-03-16T07:40:05.000Z | 2022-03-21T08:14:46.000Z | weasyl/cron.py | theSeracen/weasyl | c13b4f61f559ce44bfaee027ffc59a1379d25f3e | [
"Apache-2.0"
] | null | null | null | import arrow
from twisted.python import log
from weasyl.define import engine
from weasyl import index, submission
def run_periodic_tasks():
# An arrow object representing the current UTC time
now = arrow.utcnow()
db = engine.connect()
with db.begin():
locked = db.scalar("SELECT pg_try_adviso... | 33.035714 | 76 | 0.58973 | import arrow
from twisted.python import log
from weasyl.define import engine
from weasyl import index, submission
def run_periodic_tasks():
now = arrow.utcnow()
db = engine.connect()
with db.begin():
locked = db.scalar("SELECT pg_try_advisory_xact_lock(0)")
if not locked:
... | true | true |
1c45d908aa737c8cc2b138b76e17ef1a9a3d56e4 | 871 | py | Python | evennia/commands/default/cmdset_unloggedin.py | fermuch/evennia | 8961baa0a5b9b5419f864a144f080acc68a7ad0f | [
"BSD-3-Clause"
] | 3 | 2019-08-08T16:58:25.000Z | 2019-10-12T07:31:36.000Z | evennia/commands/default/cmdset_unloggedin.py | fermuch/evennia | 8961baa0a5b9b5419f864a144f080acc68a7ad0f | [
"BSD-3-Clause"
] | 9 | 2019-09-06T18:21:59.000Z | 2022-01-13T03:04:11.000Z | evennia/commands/default/cmdset_unloggedin.py | fermuch/evennia | 8961baa0a5b9b5419f864a144f080acc68a7ad0f | [
"BSD-3-Clause"
] | 2 | 2019-09-02T08:39:24.000Z | 2019-09-02T18:39:32.000Z | """
This module describes the unlogged state of the default game.
The setting STATE_UNLOGGED should be set to the python path
of the state instance in this module.
"""
from evennia.commands.cmdset import CmdSet
from evennia.commands.default import unloggedin
class UnloggedinCmdSet(CmdSet):
"""
Sets up the unl... | 32.259259 | 61 | 0.72101 | from evennia.commands.cmdset import CmdSet
from evennia.commands.default import unloggedin
class UnloggedinCmdSet(CmdSet):
key = "DefaultUnloggedin"
priority = 0
def at_cmdset_creation(self):
self.add(unloggedin.CmdUnconnectedConnect())
self.add(unloggedin.CmdUnconnectedCreate())
... | true | true |
1c45db6d3cecdc6f61c22f43e5bb581f20cf7a6b | 2,437 | py | Python | naeval/ner/models/tomita.py | sdspieg/naeval | 52c4a508bf212b95d4e610cfe1b5e23b8ca94d2f | [
"MIT"
] | 36 | 2020-03-22T09:37:10.000Z | 2022-01-17T14:49:30.000Z | naeval/ner/models/tomita.py | sdspieg/naeval | 52c4a508bf212b95d4e610cfe1b5e23b8ca94d2f | [
"MIT"
] | 11 | 2020-03-25T09:39:45.000Z | 2020-08-16T05:37:02.000Z | naeval/ner/models/tomita.py | sdspieg/naeval | 52c4a508bf212b95d4e610cfe1b5e23b8ca94d2f | [
"MIT"
] | 6 | 2020-05-16T05:52:04.000Z | 2022-01-16T06:45:29.000Z |
from naeval.const import TOMITA, PER
from naeval.record import Record
from naeval.io import parse_xml
from naeval.span import Span
from ..adapt import adapt_tomita
from ..markup import Markup
from .base import Model, post
TOMITA_IMAGE = 'natasha/tomita-algfio'
TOMITA_CONTAINER_PORT = 8080
TOMITA_URL = 'http://{hos... | 24.867347 | 61 | 0.622487 |
from naeval.const import TOMITA, PER
from naeval.record import Record
from naeval.io import parse_xml
from naeval.span import Span
from ..adapt import adapt_tomita
from ..markup import Markup
from .base import Model, post
TOMITA_IMAGE = 'natasha/tomita-algfio'
TOMITA_CONTAINER_PORT = 8080
TOMITA_URL = 'http://{hos... | true | true |
1c45dbebdbe4e22104a31a6023c49fc2d26290c2 | 10,611 | py | Python | src/cargrid.py | Potgront/ABM | 76fef2c7ded7e362ecf72fffd82512b9d7926700 | [
"BSD-3-Clause"
] | null | null | null | src/cargrid.py | Potgront/ABM | 76fef2c7ded7e362ecf72fffd82512b9d7926700 | [
"BSD-3-Clause"
] | null | null | null | src/cargrid.py | Potgront/ABM | 76fef2c7ded7e362ecf72fffd82512b9d7926700 | [
"BSD-3-Clause"
] | null | null | null | """
Module which defines the car agents
"""
from mesa import Agent
import numpy as np
class Car(Agent):
"""
Class which defines the inidividual car agents.
Each car has a specific unique_id and an index which is the
unique_id modulo the resolution of the LaneSpace.
Attributes:
unique_id (... | 43.310204 | 90 | 0.577985 | from mesa import Agent
import numpy as np
class Car(Agent):
def __init__(self, unique_id, model, start_lane,
speed, agression, min_gap):
super().__init__(unique_id, model)
self.start_lane = start_lane
self.index = self.unique_id % model.grid.length
self.... | true | true |
1c45dc41168fc46b895c51c21cd20daa9a2082ba | 5,247 | py | Python | splink/intuition.py | rubensmau/splink | da4f5d5bc09753b6c6974af308dd1bad324d9b4b | [
"MIT"
] | 176 | 2020-03-16T15:19:39.000Z | 2022-03-30T06:38:29.000Z | splink/intuition.py | rubensmau/splink | da4f5d5bc09753b6c6974af308dd1bad324d9b4b | [
"MIT"
] | 194 | 2020-03-01T21:32:26.000Z | 2022-03-30T14:58:38.000Z | splink/intuition.py | rubensmau/splink | da4f5d5bc09753b6c6974af308dd1bad324d9b4b | [
"MIT"
] | 25 | 2020-03-07T00:09:22.000Z | 2022-03-11T16:28:06.000Z | from .model import Model
from .charts import load_chart_definition, altair_if_installed_else_json
import pandas as pd
from math import log2
initial_template = """
Initial probability of match (prior) = λ = {lam:.4g}
"""
col_template = [
("Comparison of {column_name}. Values are:", ""),
("{column_name}_l:",... | 37.478571 | 203 | 0.692014 | from .model import Model
from .charts import load_chart_definition, altair_if_installed_else_json
import pandas as pd
from math import log2
initial_template = """
Initial probability of match (prior) = λ = {lam:.4g}
"""
col_template = [
("Comparison of {column_name}. Values are:", ""),
("{column_name}_l:",... | true | true |
1c45dd33925b9b9be524163ed7fb322778cad0d2 | 1,395 | py | Python | graph_scripts/identification_graph.py | karannewatia/Mycelium | c20deab29d97025d7623af4bbf97f79f3132b415 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | 3 | 2022-01-19T18:14:42.000Z | 2022-02-07T19:16:17.000Z | graph_scripts/identification_graph.py | karannewatia/Mycelium | c20deab29d97025d7623af4bbf97f79f3132b415 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | graph_scripts/identification_graph.py | karannewatia/Mycelium | c20deab29d97025d7623af4bbf97f79f3132b415 | [
"MIT",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['pdf.fonttype'] = 42
plt.rcParams['ps.fonttype'] = 42
malice_vals = [0.005, 0.01, 0.02, 0.04]
ind = np.arange(4)
#replace these with the data obtained from identification.py
k2r1 = [0.0, 0.0, 0.0008000000000000229, 0.0015999999999999348]
k2r2 = [0.0, ... | 36.710526 | 79 | 0.682437 | import numpy as np
import matplotlib.pyplot as plt
plt.rcParams['pdf.fonttype'] = 42
plt.rcParams['ps.fonttype'] = 42
malice_vals = [0.005, 0.01, 0.02, 0.04]
ind = np.arange(4)
k2r1 = [0.0, 0.0, 0.0008000000000000229, 0.0015999999999999348]
k2r2 = [0.0, 0.0, 0.0008000000000000229, 0.0033000000000004137]
k2r3 = [0... | true | true |
1c45dd47cd5d01f117d4d2dabd7d739958d96331 | 1,591 | py | Python | setup.py | arpitban/integrate | c991a50546229c2341ad5d8571c72c819c06c4b2 | [
"MIT"
] | null | null | null | setup.py | arpitban/integrate | c991a50546229c2341ad5d8571c72c819c06c4b2 | [
"MIT"
] | null | null | null | setup.py | arpitban/integrate | c991a50546229c2341ad5d8571c72c819c06c4b2 | [
"MIT"
] | null | null | null | """
integrate
Package to integrate functions
"""
from setuptools import setup
import versioneer
DOCLINES = __doc__.split("\n")
setup(
# Self-descriptive entries which should always be present
name='integrate',
author='Arpit Bansal',
description=DOCLINES[0],
long_description="\n".join(DOCLINES[2:])... | 34.586957 | 118 | 0.657448 | from setuptools import setup
import versioneer
DOCLINES = __doc__.split("\n")
setup(
name='integrate',
author='Arpit Bansal',
description=DOCLINES[0],
long_description="\n".join(DOCLINES[2:]),
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
license='MIT',
ins... | true | true |
1c45dd9a6f5f623f74d785fbdbad56a08b56d3f5 | 2,746 | py | Python | xknx/remote_value/remote_value_control.py | magicbear/xknx | e6fe7bbd292e0fee29b2c4f210aff3031d76539d | [
"MIT"
] | 1 | 2021-01-24T21:08:36.000Z | 2021-01-24T21:08:36.000Z | xknx/remote_value/remote_value_control.py | magicbear/xknx | e6fe7bbd292e0fee29b2c4f210aff3031d76539d | [
"MIT"
] | 54 | 2021-10-01T17:42:16.000Z | 2022-03-31T09:22:46.000Z | xknx/remote_value/remote_value_control.py | crazyfx1/xknx | 87666cc9bd9da64a84305baeff84486097346111 | [
"MIT"
] | null | null | null | """
Module for managing a control remote value.
Examples are switching commands with priority control, relative dimming or blinds control commands.
DPT 2.yyy and DPT 3.yyy
"""
from __future__ import annotations
from typing import TYPE_CHECKING, Any
from xknx.dpt import DPTArray, DPTBinary, DPTControlStepCode
from xk... | 36.131579 | 100 | 0.664967 | from __future__ import annotations
from typing import TYPE_CHECKING, Any
from xknx.dpt import DPTArray, DPTBinary, DPTControlStepCode
from xknx.exceptions import ConversionError
from .remote_value import AsyncCallbackType, GroupAddressesType, RemoteValue
if TYPE_CHECKING:
from xknx.xknx import XKNX
class Remo... | true | true |
1c45dde6f471e6c02e753f85eac93a9d22fbde55 | 3,277 | py | Python | sphinx/pocketsphinx-5prealpha/swig/python/test/decoder_test.py | anshsarkar/TailBench | 25845756aee9a892229c25b681051591c94daafd | [
"MIT"
] | 2 | 2021-01-13T21:17:42.000Z | 2021-01-13T21:17:42.000Z | sphinx/pocketsphinx-5prealpha/swig/python/test/decoder_test.py | anshsarkar/TailBench | 25845756aee9a892229c25b681051591c94daafd | [
"MIT"
] | null | null | null | sphinx/pocketsphinx-5prealpha/swig/python/test/decoder_test.py | anshsarkar/TailBench | 25845756aee9a892229c25b681051591c94daafd | [
"MIT"
] | null | null | null | # ====================================================================
# Copyright (c) 2013 Carnegie Mellon University. All rights
# reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of... | 38.552941 | 121 | 0.712237 |
from os import environ, path
from pocketsphinx.pocketsphinx import *
from sphinxbase.sphinxbase import *
MODELDIR = "../../../model"
DATADIR = "../../../test/data"
config = Decoder.default_config()
config.set_string('-hmm', path.join(MODELDIR, 'en-us/en-us'))
config.set_string('-... | true | true |
1c45ddeda1ba48e329cee4025e6983697c5c5850 | 512 | py | Python | scipy/sparse/linalg/setup.py | lorentzenchr/scipy | 393a05ee927883ad6316b7092c851afea8f16816 | [
"BSD-3-Clause"
] | 9,095 | 2015-01-02T18:24:23.000Z | 2022-03-31T20:35:31.000Z | scipy/sparse/linalg/setup.py | lorentzenchr/scipy | 393a05ee927883ad6316b7092c851afea8f16816 | [
"BSD-3-Clause"
] | 11,500 | 2015-01-01T01:15:30.000Z | 2022-03-31T23:07:35.000Z | scipy/sparse/linalg/setup.py | lorentzenchr/scipy | 393a05ee927883ad6316b7092c851afea8f16816 | [
"BSD-3-Clause"
] | 5,838 | 2015-01-05T11:56:42.000Z | 2022-03-31T23:21:19.000Z |
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('linalg', parent_package, top_path)
config.add_subpackage('_isolve')
config.add_subpackage('_dsolve')
config.add_subpackage('_eigen')
config.add_data_dir('tests')
... | 23.272727 | 62 | 0.71875 |
def configuration(parent_package='', top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('linalg', parent_package, top_path)
config.add_subpackage('_isolve')
config.add_subpackage('_dsolve')
config.add_subpackage('_eigen')
config.add_data_dir('tests')
... | true | true |
1c45de15d7b5493f204a2593fa32d8e68e6eccbf | 612 | py | Python | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/GREMEDY/string_marker.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/GREMEDY/string_marker.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | OpenGLWrapper_JE/venv/Lib/site-packages/OpenGL/raw/GL/GREMEDY/string_marker.py | JE-Chen/je_old_repo | a8b2f1ac2eec25758bd15b71c64b59b27e0bcda5 | [
"MIT"
] | null | null | null | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import... | 34 | 119 | 0.776144 | from OpenGL import platform as _p, arrays
from OpenGL.raw.GL import _types as _cs
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_EXTENSION_NAME = 'GL_GREMEDY_string_marker'
def _f( function ):
return _p.createFunction( funct... | true | true |
1c45decc0c487ca311ecba9f0e1ff22edc6b5a52 | 10,437 | bzl | Python | tools/build_defs/repo/git.bzl | FengRillian/bazel | c962975f152e30741a3affb1d41dd885543bbea6 | [
"Apache-2.0"
] | 3 | 2019-03-18T23:49:16.000Z | 2021-05-30T09:44:18.000Z | tools/build_defs/repo/git.bzl | FengRillian/bazel | c962975f152e30741a3affb1d41dd885543bbea6 | [
"Apache-2.0"
] | null | null | null | tools/build_defs/repo/git.bzl | FengRillian/bazel | c962975f152e30741a3affb1d41dd885543bbea6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 38.655556 | 107 | 0.678547 |
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "patch", "update_attrs", "workspace_and_buildfile")
def _clone_or_update(ctx):
if ((not ctx.attr.tag and not ctx.attr.commit and not ctx.attr.branch) or
(ctx.attr.tag and ctx.attr.commit) or
(ctx.attr.tag and ctx.attr.branch) or
... | true | true |
1c45dee6a500635eabaad87541b2131f941e9a46 | 69,722 | py | Python | kgtk/io/kgtkreader.py | dgarijo/kgtk | f624754e91afbad8d28006e716189b43d367ef04 | [
"MIT"
] | null | null | null | kgtk/io/kgtkreader.py | dgarijo/kgtk | f624754e91afbad8d28006e716189b43d367ef04 | [
"MIT"
] | null | null | null | kgtk/io/kgtkreader.py | dgarijo/kgtk | f624754e91afbad8d28006e716189b43d367ef04 | [
"MIT"
] | null | null | null | """Read a KGTK node or edge file in TSV format.
Normally, results are obtained as rows of string values obtained by iteration
on the KgtkReader object. Alternative iterators are available to return the results
as:
* concise_rows: lists of strings with empty fields converted to None
* kgtk_values:... | 49.238701 | 188 | 0.586486 |
from argparse import ArgumentParser, _ArgumentGroup, Namespace, SUPPRESS
import attr
import bz2
from enum import Enum
import gzip
import lz4
import lzma
from multiprocessing import Process, Queue
from pathlib import Path
import sys
import typing
from kgtk.kgtkformat import KgtkFormat
from kgtk.io.kgtkbase import Kgt... | true | true |
1c45e033fc674af02e4beaed1d9dd8f01d305f9a | 686 | py | Python | app/core/management/commands/wait_for_db.py | amir-rz/recipe-app-api | 69f8c2ee801cd4bf909979bd246b8fe1bf9e2d60 | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | amir-rz/recipe-app-api | 69f8c2ee801cd4bf909979bd246b8fe1bf9e2d60 | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | amir-rz/recipe-app-api | 69f8c2ee801cd4bf909979bd246b8fe1bf9e2d60 | [
"MIT"
] | null | null | null | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
""" Django command to pause excuation until database is available """
def handle(self, *args, **options):
self.stdout.write("Wait... | 34.3 | 82 | 0.650146 | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
def handle(self, *args, **options):
self.stdout.write("Waiting for database...")
db_conn = None
while not db_conn:
... | true | true |
1c45e09129bfd3cd066e0bd3ca94b7df369924d0 | 962 | py | Python | atriage/collectors/flatdir.py | Ayrx/atriage | 6e928da0d673260e61e089f69cb56555c7d9cdf6 | [
"Apache-2.0"
] | 11 | 2017-12-17T12:18:56.000Z | 2021-05-10T23:11:29.000Z | atriage/collectors/flatdir.py | Ayrx/atriage | 6e928da0d673260e61e089f69cb56555c7d9cdf6 | [
"Apache-2.0"
] | 7 | 2018-10-01T08:46:24.000Z | 2021-06-01T21:48:44.000Z | atriage/collectors/flatdir.py | Ayrx/atriage | 6e928da0d673260e61e089f69cb56555c7d9cdf6 | [
"Apache-2.0"
] | 3 | 2017-12-17T12:19:00.000Z | 2019-03-25T09:31:52.000Z | from atriage.collectors.exceptions import NoopException
from atriage.collectors.interface import CollectorInterface
from pathlib import Path
import click
class FlatDirCollector(object):
name = "flat-dir-collector"
def __init__(self, results):
self._results = results
def parse_directory(self, ... | 24.05 | 62 | 0.660083 | from atriage.collectors.exceptions import NoopException
from atriage.collectors.interface import CollectorInterface
from pathlib import Path
import click
class FlatDirCollector(object):
name = "flat-dir-collector"
def __init__(self, results):
self._results = results
def parse_directory(self, ... | true | true |
1c45e18204e4eaacee40b946650e58bb8faf467c | 2,264 | py | Python | email/sphinxcontrib/email.py | Tommy1969/sphinx-contrib | d479ece0fe6c2f33bbebcc52677035d5003b7b35 | [
"BSD-2-Clause"
] | 14 | 2016-02-22T12:06:54.000Z | 2021-01-05T07:01:43.000Z | email/sphinxcontrib/email.py | SuperKogito/sphinx-contrib | 3b643bffb90a27ae378717ae6335873a0e73cf9d | [
"BSD-2-Clause"
] | 8 | 2015-03-06T13:46:49.000Z | 2019-10-09T08:53:14.000Z | email/sphinxcontrib/email.py | SuperKogito/sphinx-contrib | 3b643bffb90a27ae378717ae6335873a0e73cf9d | [
"BSD-2-Clause"
] | 16 | 2015-05-25T02:51:05.000Z | 2020-01-17T05:49:47.000Z | # E-mail obfuscation role for Sphinx.
from docutils import nodes
# The obfuscation code was taken from
#
# http://pypi.python.org/pypi/bud.nospam
#
# and was was released by Kevin Teague <kevin at bud ca> under
# a BSD license.
import re
try:
maketrans = ''.maketrans
except AttributeError:
# fallback for ... | 27.277108 | 76 | 0.605124 |
from docutils import nodes
import re
try:
maketrans = ''.maketrans
except AttributeError:
from string import maketrans
rot_13_trans = maketrans(
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
'NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm'
)
def rot_13_encrypt(line):
... | true | true |
1c45e1cfb9f789049e129d5f970c555b0f0ffd3c | 15,669 | py | Python | distributed/stealing.py | dchudz/distributed | 591bca00af4fc07d0c5cac5189fc3b08ef8a93cd | [
"BSD-3-Clause"
] | null | null | null | distributed/stealing.py | dchudz/distributed | 591bca00af4fc07d0c5cac5189fc3b08ef8a93cd | [
"BSD-3-Clause"
] | null | null | null | distributed/stealing.py | dchudz/distributed | 591bca00af4fc07d0c5cac5189fc3b08ef8a93cd | [
"BSD-3-Clause"
] | null | null | null | import logging
from collections import defaultdict, deque
from math import log2
from time import time
from tlz import topk
from tornado.ioloop import PeriodicCallback
import dask
from dask.utils import parse_timedelta
from .comm.addressing import get_address_host
from .core import CommClosedError
from .diagnostics.p... | 34.286652 | 88 | 0.521029 | import logging
from collections import defaultdict, deque
from math import log2
from time import time
from tlz import topk
from tornado.ioloop import PeriodicCallback
import dask
from dask.utils import parse_timedelta
from .comm.addressing import get_address_host
from .core import CommClosedError
from .diagnostics.p... | true | true |
1c45e29f710037c91f2e554142171caeedf3bf05 | 4,923 | py | Python | src/lidar.py | steviet91/furmulaone_source | ca738b271fa346da4234c5ffc781abc12a5ac49f | [
"MIT"
] | null | null | null | src/lidar.py | steviet91/furmulaone_source | ca738b271fa346da4234c5ffc781abc12a5ac49f | [
"MIT"
] | 24 | 2020-04-14T12:38:07.000Z | 2020-04-29T08:18:33.000Z | src/lidar.py | steviet91/furmulaone_source | ca738b271fa346da4234c5ffc781abc12a5ac49f | [
"MIT"
] | null | null | null | import numpy as np
from .track import TrackHandler
from .geom import Line
from .geom import Circle
from .geom import get_intersection_point_lineseg_lineseg
from .geom import calc_euclid_distance_2d
from .geom import rotate_point
import time
#from multiprocessing import Pool
class Lidar(object):
"""
Object ... | 33.719178 | 97 | 0.589681 | import numpy as np
from .track import TrackHandler
from .geom import Line
from .geom import Circle
from .geom import get_intersection_point_lineseg_lineseg
from .geom import calc_euclid_distance_2d
from .geom import rotate_point
import time
class Lidar(object):
_NRays = 3
_xLidarRange = float(200)
def __... | true | true |
1c45e2b8f9e20b2f3b7d0e052c8fd311816a6a16 | 1,984 | py | Python | carball/analysis2/stats/demo_stats.py | twobackfromtheend/carball | 6dcc3f7f0f2266cc3e0a3de24deaac2aec392b73 | [
"Apache-2.0"
] | null | null | null | carball/analysis2/stats/demo_stats.py | twobackfromtheend/carball | 6dcc3f7f0f2266cc3e0a3de24deaac2aec392b73 | [
"Apache-2.0"
] | null | null | null | carball/analysis2/stats/demo_stats.py | twobackfromtheend/carball | 6dcc3f7f0f2266cc3e0a3de24deaac2aec392b73 | [
"Apache-2.0"
] | null | null | null | from collections import Counter
from typing import Dict, List
import numpy as np
import pandas as pd
from api.analysis.stats_pb2 import PlayerStats
from api.events.demo_pb2 import Demo
from api.game.game_pb2 import Game
from carball.analysis2.constants.constants import FIELD_Y_LIM, FIELD_X_LIM
def set_demo_stats(pl... | 39.68 | 112 | 0.720766 | from collections import Counter
from typing import Dict, List
import numpy as np
import pandas as pd
from api.analysis.stats_pb2 import PlayerStats
from api.events.demo_pb2 import Demo
from api.game.game_pb2 import Game
from carball.analysis2.constants.constants import FIELD_Y_LIM, FIELD_X_LIM
def set_demo_stats(pl... | true | true |
1c45e33ca52708a7eea05a4c0e1c5e724e56f6ba | 3,556 | py | Python | deploytesting/settings.py | mouaadBenAllal/deploytest | 1011152d3a00879f450db3deaef64dee7c9009c0 | [
"Apache-2.0"
] | null | null | null | deploytesting/settings.py | mouaadBenAllal/deploytest | 1011152d3a00879f450db3deaef64dee7c9009c0 | [
"Apache-2.0"
] | null | null | null | deploytesting/settings.py | mouaadBenAllal/deploytest | 1011152d3a00879f450db3deaef64dee7c9009c0 | [
"Apache-2.0"
] | null | null | null | """
Django settings for deploytesting project.
Generated by 'django-admin startproject' using Django 1.10.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
imp... | 28.448 | 102 | 0.708661 |
import os
SECRET_KEY = os.environ.get('DJANGO_SECRET_KEY', '!5+^n3g458fs0#x8=142wf+5xqkw2)nb5^_zkry-g2fl&8@rn_')
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# DEBUG = True
DEBUG = bool(os.environ.get('DJANGO_DEBUG', True))
ALLOWED_HOSTS = ['Mouaadben.pythonanywhere.com']
# Applic... | true | true |
1c45e454061369b7ef00827dbb014ceacea5b029 | 212 | py | Python | lambdata_andrewarnett/__init__.py | AndrewArnett/lambdata | fe7e2694a0a099f9df88807f744556c230e9f18d | [
"MIT"
] | null | null | null | lambdata_andrewarnett/__init__.py | AndrewArnett/lambdata | fe7e2694a0a099f9df88807f744556c230e9f18d | [
"MIT"
] | null | null | null | lambdata_andrewarnett/__init__.py | AndrewArnett/lambdata | fe7e2694a0a099f9df88807f744556c230e9f18d | [
"MIT"
] | 1 | 2020-08-04T19:20:50.000Z | 2020-08-04T19:20:50.000Z | """
lambdata - a collection of Data Science helper functions
"""
import pandas as pd
import numpy as np
from lambdata_andrewarnett.dataframe_helper import shape_head, baseline
TEST = pd.DataFrame(np.ones(10))
| 19.272727 | 71 | 0.783019 |
import pandas as pd
import numpy as np
from lambdata_andrewarnett.dataframe_helper import shape_head, baseline
TEST = pd.DataFrame(np.ones(10))
| true | true |
1c45e47eae4c91731680b35fa0da9f2d7d523680 | 10,928 | py | Python | mindmeld/components/_elasticsearch_helpers.py | jre21/mindmeld | 6a88e4b0dfc7971f6bf9ae406b89dbc76f68af81 | [
"Apache-2.0"
] | 1 | 2021-01-06T23:39:57.000Z | 2021-01-06T23:39:57.000Z | mindmeld/components/_elasticsearch_helpers.py | jre21/mindmeld | 6a88e4b0dfc7971f6bf9ae406b89dbc76f68af81 | [
"Apache-2.0"
] | 1 | 2021-02-02T22:53:01.000Z | 2021-02-02T22:53:01.000Z | mindmeld/components/_elasticsearch_helpers.py | jre21/mindmeld | 6a88e4b0dfc7971f6bf9ae406b89dbc76f68af81 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. 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... | 46.901288 | 99 | 0.685212 |
import os
import logging
from elasticsearch5 import (Elasticsearch, ImproperlyConfigured, ElasticsearchException,
ConnectionError as EsConnectionError, TransportError)
from elasticsearch5.helpers import streaming_bulk
from tqdm import tqdm
from ._config import DEFAULT_ES_INDEX... | true | true |
1c45e48a779bc28e0a8409233594b33b5c303ad5 | 376 | py | Python | test/test_ynab.py | quinnhosler/ynab-sdk-python | 4ef8040bb44216212a84c8990329dcf63972e0fa | [
"Apache-2.0"
] | null | null | null | test/test_ynab.py | quinnhosler/ynab-sdk-python | 4ef8040bb44216212a84c8990329dcf63972e0fa | [
"Apache-2.0"
] | null | null | null | test/test_ynab.py | quinnhosler/ynab-sdk-python | 4ef8040bb44216212a84c8990329dcf63972e0fa | [
"Apache-2.0"
] | null | null | null | from unittest import TestCase
from test.support.dummy_client import DummyClient
from ynab_sdk import YNAB
class YNABTest(TestCase):
ynab: YNAB
client: DummyClient
def setUp(self):
self.client = DummyClient()
self.ynab = YNAB(client=self.client)
def test_client_requires_key_or_client... | 22.117647 | 49 | 0.728723 | from unittest import TestCase
from test.support.dummy_client import DummyClient
from ynab_sdk import YNAB
class YNABTest(TestCase):
ynab: YNAB
client: DummyClient
def setUp(self):
self.client = DummyClient()
self.ynab = YNAB(client=self.client)
def test_client_requires_key_or_client... | true | true |
1c45e570f903cc0c5df4101b24907713afacfe1b | 1,034 | py | Python | test/app/all_tests.py | chuyqa/pydoop | 575f56cc66381fef08981a2452acde02bddf0363 | [
"Apache-2.0"
] | 1 | 2021-03-22T02:22:30.000Z | 2021-03-22T02:22:30.000Z | test/app/all_tests.py | chuyqa/pydoop | 575f56cc66381fef08981a2452acde02bddf0363 | [
"Apache-2.0"
] | null | null | null | test/app/all_tests.py | chuyqa/pydoop | 575f56cc66381fef08981a2452acde02bddf0363 | [
"Apache-2.0"
] | null | null | null | # BEGIN_COPYRIGHT
#
# Copyright 2009-2018 CRS4.
#
# 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 agree... | 26.512821 | 77 | 0.737911 |
import unittest
from pydoop.test_utils import get_module
TEST_MODULE_NAMES = [
'test_submit',
]
def suite(path=None):
suites = []
for module in TEST_MODULE_NAMES:
suites.append(get_module(module, path).suite())
return unittest.TestSuite(suites)
if __name__ == '__main__':
... | true | true |
1c45e61545b2b62f4211d66f7c74da507f7af9e4 | 15,352 | py | Python | tests/unit/test_hooks.py | i386x/tox-lsr | 22f4d63d58050b1c1bee2e91eb239c31f35cfd13 | [
"MIT"
] | null | null | null | tests/unit/test_hooks.py | i386x/tox-lsr | 22f4d63d58050b1c1bee2e91eb239c31f35cfd13 | [
"MIT"
] | null | null | null | tests/unit/test_hooks.py | i386x/tox-lsr | 22f4d63d58050b1c1bee2e91eb239c31f35cfd13 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# SPDX-License-Identifier: MIT
#
"""Tests for tox_lsr hooks."""
import os
import shutil
import tempfile
try:
from unittest import mock as unittest_mock
from unittest.mock import MagicMock, Mock, patch
except ImportError:
impor... | 36.293144 | 79 | 0.572108 |
import os
import shutil
import tempfile
try:
from unittest import mock as unittest_mock
from unittest.mock import MagicMock, Mock, patch
except ImportError:
import mock as unittest_mock
from mock import MagicMock, Mock, patch
from copy import deepcopy
import pkg_resources
import py.iniconf... | true | true |
1c45e7af81826e60de1299cc184fcbaf42464f56 | 3,170 | py | Python | lists/tests/test_models.py | brendanodwyer/python-tdd-book | ff3a8a8254a3112937ce9924dfa05ba52069c8bf | [
"Apache-2.0"
] | null | null | null | lists/tests/test_models.py | brendanodwyer/python-tdd-book | ff3a8a8254a3112937ce9924dfa05ba52069c8bf | [
"Apache-2.0"
] | null | null | null | lists/tests/test_models.py | brendanodwyer/python-tdd-book | ff3a8a8254a3112937ce9924dfa05ba52069c8bf | [
"Apache-2.0"
] | null | null | null | from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.test import TestCase
from lists.models import Item
from lists.models import List
User = get_user_model()
class ItemModelTest(TestCase):
def test_default_text(self):
item = Item()
self.as... | 34.086022 | 73 | 0.667508 | from django.contrib.auth import get_user_model
from django.core.exceptions import ValidationError
from django.test import TestCase
from lists.models import Item
from lists.models import List
User = get_user_model()
class ItemModelTest(TestCase):
def test_default_text(self):
item = Item()
self.as... | true | true |
1c45e7bb27a310e77f8849bbd05bd8e62fc757bb | 12,127 | py | Python | core/domain/caching_services.py | prayutsu/oppia | e82da7653f7bbfb9ded0e1ba16cd9f481ff5a786 | [
"Apache-2.0"
] | 2 | 2020-10-13T12:59:08.000Z | 2020-10-13T17:10:26.000Z | core/domain/caching_services.py | gitter-badger/oppia | 7d8e659264582d7ce74bc6c139e597b82bca0e04 | [
"Apache-2.0"
] | 35 | 2019-02-23T20:31:21.000Z | 2019-08-19T12:32:13.000Z | core/domain/caching_services.py | gitter-badger/oppia | 7d8e659264582d7ce74bc6c139e597b82bca0e04 | [
"Apache-2.0"
] | 1 | 2021-08-13T07:54:56.000Z | 2021-08-13T07:54:56.000Z | # coding: utf-8
#
# Copyright 2020 The Oppia 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 requi... | 45.762264 | 80 | 0.740002 |
from __future__ import absolute_import
from __future__ import unicode_literals
import json
from core.domain import collection_domain
from core.domain import exp_domain
from core.domain import platform_parameter_domain
from core.domain import skill_domain
from core.domain import story_domain
from ... | true | true |
1c45e7bf89b8194eb005c56d95a2d6c85d741f03 | 326 | py | Python | pa05_find_max.py | jpch89/picalgo | 73aa98e477c68bb39d337914065c0fe1b4bad756 | [
"MIT"
] | null | null | null | pa05_find_max.py | jpch89/picalgo | 73aa98e477c68bb39d337914065c0fe1b4bad756 | [
"MIT"
] | null | null | null | pa05_find_max.py | jpch89/picalgo | 73aa98e477c68bb39d337914065c0fe1b4bad756 | [
"MIT"
] | null | null | null | def find_max(arr):
if len(arr) == 1:
return arr[0]
elif len(arr) == 2:
return arr[0] if arr[0] > arr[1] else arr[1]
first = arr[0]
second = find_max(arr[1:])
return first if first > second else second
if __name__ == '__main__':
arr = [1, 7, 4, 8]
print(find_max(arr))
"""
... | 17.157895 | 52 | 0.53681 | def find_max(arr):
if len(arr) == 1:
return arr[0]
elif len(arr) == 2:
return arr[0] if arr[0] > arr[1] else arr[1]
first = arr[0]
second = find_max(arr[1:])
return first if first > second else second
if __name__ == '__main__':
arr = [1, 7, 4, 8]
print(find_max(arr))
| true | true |
1c45e9e5f64d477f9fcc29374315d1729650f609 | 7,784 | py | Python | tensorflow/tools/pip_package/setup.py | jjzhang166/tensorflow | 61c0b39011671628ee85c2b49bc8845520018aa2 | [
"Apache-2.0"
] | 3 | 2017-05-31T01:33:48.000Z | 2020-02-18T17:12:56.000Z | tensorflow/tools/pip_package/setup.py | jjzhang166/tensorflow | 61c0b39011671628ee85c2b49bc8845520018aa2 | [
"Apache-2.0"
] | null | null | null | tensorflow/tools/pip_package/setup.py | jjzhang166/tensorflow | 61c0b39011671628ee85c2b49bc8845520018aa2 | [
"Apache-2.0"
] | 1 | 2018-12-28T12:55:11.000Z | 2018-12-28T12:55:11.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.264957 | 80 | 0.675745 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import fnmatch
import os
import re
import sys
from setuptools import find_packages, setup, Command
from setuptools.command.install import install as InstallCommandBase
from setuptools.dist impor... | true | true |
1c45eac1149605f449ce85664d9f605d2ddc6d4b | 14,968 | py | Python | release/python/l2tester/interface.py | gringolito/l2tester | eb8eddad6a9fee33e05e0d8d601229cd704e5464 | [
"MIT"
] | 8 | 2018-04-05T12:05:42.000Z | 2021-07-01T10:44:29.000Z | release/python/l2tester/interface.py | gringolito/l2tester | eb8eddad6a9fee33e05e0d8d601229cd704e5464 | [
"MIT"
] | 6 | 2018-04-05T10:36:31.000Z | 2021-08-08T08:06:13.000Z | release/python/l2tester/interface.py | gringolito/l2tester | eb8eddad6a9fee33e05e0d8d601229cd704e5464 | [
"MIT"
] | 9 | 2018-04-04T19:15:49.000Z | 2021-08-07T10:17:10.000Z |
try:
from pyroute2 import IPRoute
except:
raise Exception("""
l2tester.interface depends on the following module:
* pyroute2 : available at https://pypi.python.org/pypi/pyroute2
Download .tar.gz, extract it, enter folder and run 'sudo python setup.py install' to install this module.
""")
import socket
impor... | 38.183673 | 120 | 0.587654 |
try:
from pyroute2 import IPRoute
except:
raise Exception("""
l2tester.interface depends on the following module:
* pyroute2 : available at https://pypi.python.org/pypi/pyroute2
Download .tar.gz, extract it, enter folder and run 'sudo python setup.py install' to install this module.
""")
import socket
impor... | true | true |
1c45eb2407679dda457ec86794fdeaee8e70ab96 | 90,227 | py | Python | src/reportlab/pdfbase/pdfdoc.py | radjkarl/reportlab | 48cafb6d64ff92fd9d4f9a4dd888be6f7d55b765 | [
"BSD-3-Clause"
] | 51 | 2015-01-20T19:50:34.000Z | 2022-03-05T21:23:32.000Z | src/reportlab/pdfbase/pdfdoc.py | radjkarl/reportlab | 48cafb6d64ff92fd9d4f9a4dd888be6f7d55b765 | [
"BSD-3-Clause"
] | 16 | 2015-11-15T04:23:43.000Z | 2021-09-27T14:14:20.000Z | src/reportlab/pdfbase/pdfdoc.py | radjkarl/reportlab | 48cafb6d64ff92fd9d4f9a4dd888be6f7d55b765 | [
"BSD-3-Clause"
] | 46 | 2015-03-28T10:18:14.000Z | 2021-12-16T15:57:47.000Z | #Copyright ReportLab Europe Ltd. 2000-2012
#see license.txt for license details
#history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/pdfbase/pdfdoc.py
__version__=''' $Id$ '''
__doc__="""
The module pdfdoc.py handles the 'outer structure' of PDF documents, ensuring that
all objects a... | 37.438589 | 178 | 0.594501 |
__version__=''' $Id$ '''
__doc__="""
The module pdfdoc.py handles the 'outer structure' of PDF documents, ensuring that
all objects are properly cross-referenced and indexed to the nearest byte. The
'inner structure' - the page descriptions - are presumed to be generated before
each page is saved.
pdfgen.py calls t... | true | true |
1c45ebcafc988d6417656fc2f57c14e952094419 | 591 | py | Python | kombu/asynchronous/http/__init__.py | kaiix/kombu | 580b5219cc50cad278c4b664d0e0f85e37a5e9ea | [
"BSD-3-Clause"
] | 1,920 | 2015-01-03T15:43:23.000Z | 2022-03-30T19:30:35.000Z | kombu/asynchronous/http/__init__.py | kaiix/kombu | 580b5219cc50cad278c4b664d0e0f85e37a5e9ea | [
"BSD-3-Clause"
] | 949 | 2015-01-02T18:56:00.000Z | 2022-03-31T23:14:59.000Z | kombu/asynchronous/http/__init__.py | kaiix/kombu | 580b5219cc50cad278c4b664d0e0f85e37a5e9ea | [
"BSD-3-Clause"
] | 833 | 2015-01-07T23:56:35.000Z | 2022-03-31T22:04:11.000Z | from kombu.asynchronous import get_event_loop
from .base import Headers, Request, Response
__all__ = ('Client', 'Headers', 'Response', 'Request')
def Client(hub=None, **kwargs):
"""Create new HTTP client."""
from .curl import CurlClient
return CurlClient(hub, **kwargs)
def get_client(hub=None, **kwarg... | 26.863636 | 68 | 0.685279 | from kombu.asynchronous import get_event_loop
from .base import Headers, Request, Response
__all__ = ('Client', 'Headers', 'Response', 'Request')
def Client(hub=None, **kwargs):
from .curl import CurlClient
return CurlClient(hub, **kwargs)
def get_client(hub=None, **kwargs):
hub = hub or get_event_loo... | true | true |
1c45ec2cae11560444aa0d63d936a8e946da8104 | 1,851 | py | Python | setup.py | lassejaco/pretix-eth-payment-plugin | be514a7387de8399cb11c9dd8971f286ccc9a72c | [
"Apache-2.0"
] | null | null | null | setup.py | lassejaco/pretix-eth-payment-plugin | be514a7387de8399cb11c9dd8971f286ccc9a72c | [
"Apache-2.0"
] | null | null | null | setup.py | lassejaco/pretix-eth-payment-plugin | be514a7387de8399cb11c9dd8971f286ccc9a72c | [
"Apache-2.0"
] | null | null | null | import os
from distutils.command.build import build # type: ignore
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.md'), encoding='utf-8') as f:
long_description = f.read()
class CustomBuild(build):
def run(self):
from django.core import manage... | 24.68 | 87 | 0.622907 | import os
from distutils.command.build import build
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), 'README.md'), encoding='utf-8') as f:
long_description = f.read()
class CustomBuild(build):
def run(self):
from django.core import management
m... | true | true |
1c45ef8254822d3c204624c76142cdc54dcca2e2 | 457 | py | Python | dedomeno/houses/migrations/0098_auto_20170117_1650.py | ginopalazzo/dedomeno | e43df365849102016c8819b2082d2cde9109360f | [
"MIT"
] | 38 | 2018-03-19T12:52:17.000Z | 2022-02-17T14:45:57.000Z | dedomeno/houses/migrations/0098_auto_20170117_1650.py | ginopalazzo/dedomeno | e43df365849102016c8819b2082d2cde9109360f | [
"MIT"
] | 7 | 2020-02-11T23:01:40.000Z | 2020-08-06T13:30:58.000Z | dedomeno/houses/migrations/0098_auto_20170117_1650.py | ginopalazzo/dedomeno | e43df365849102016c8819b2082d2cde9109360f | [
"MIT"
] | 12 | 2019-02-23T22:10:34.000Z | 2022-03-24T12:01:38.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-01-17 15:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('houses', '0097_property_online'),
]
operations = [
migrations.AlterField(
... | 21.761905 | 58 | 0.61488 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('houses', '0097_property_online'),
]
operations = [
migrations.AlterField(
model_name='realestate',
name='desc',
... | true | true |
1c45f025c99e2b8c21037589076efa5e71227813 | 17,668 | py | Python | graphsage/unsupervised_train.py | LiTszOn/GraphSAGE | dbeb50d52e8d242b3c4ad3e4264c168a2c406e70 | [
"MIT"
] | null | null | null | graphsage/unsupervised_train.py | LiTszOn/GraphSAGE | dbeb50d52e8d242b3c4ad3e4264c168a2c406e70 | [
"MIT"
] | null | null | null | graphsage/unsupervised_train.py | LiTszOn/GraphSAGE | dbeb50d52e8d242b3c4ad3e4264c168a2c406e70 | [
"MIT"
] | null | null | null | from __future__ import division
from __future__ import print_function
import os
import time
import tensorflow as tf
import numpy as np
from graphsage.models import SampleAndAggregate, SAGEInfo, Node2VecModel
from graphsage.minibatch import EdgeMinibatchIterator
from graphsage.neigh_samplers import UniformNeighborSamp... | 45.302564 | 129 | 0.586258 | from __future__ import division
from __future__ import print_function
import os
import time
import tensorflow as tf
import numpy as np
from graphsage.models import SampleAndAggregate, SAGEInfo, Node2VecModel
from graphsage.minibatch import EdgeMinibatchIterator
from graphsage.neigh_samplers import UniformNeighborSamp... | true | true |
1c45f085e004e34a83549f22c405ac311d6001c4 | 48,492 | bzl | Python | examples/crate_universe/vendor_remote_pkgs/crates/defs.bzl | cfredric/rules_rust | 521e649ff44e9711fe3c45b0ec1e792f7e1d361e | [
"Apache-2.0"
] | null | null | null | examples/crate_universe/vendor_remote_pkgs/crates/defs.bzl | cfredric/rules_rust | 521e649ff44e9711fe3c45b0ec1e792f7e1d361e | [
"Apache-2.0"
] | null | null | null | examples/crate_universe/vendor_remote_pkgs/crates/defs.bzl | cfredric/rules_rust | 521e649ff44e9711fe3c45b0ec1e792f7e1d361e | [
"Apache-2.0"
] | null | null | null | ###############################################################################
# @generated
# This file is auto-generated by the cargo-bazel tool.
#
# DO NOT MODIFY: Local changes may be replaced in future executions.
###############################################################################
"""
# `crates_reposit... | 40.477462 | 552 | 0.644086 | es.io/api/v1/crates/matches/0.1.9/download"],
strip_prefix = "matches-0.1.9",
build_file = Label("@examples//vendor_remote_pkgs/crates:BUILD.matches-0.1.9.bazel"),
)
maybe(
http_archive,
name = "crates_vendor_pkgs__matchit-0.4.6",
sha256 = "9376a4f0340565ad675d11fc141922... | true | true |
1c45f0f1abed23f91b8387f0e241a1dcfc49a84b | 3,035 | py | Python | examples/neurospin/histogram_fits.py | fperez/nipy | 559f17150bd9fa8ead4fd088b330d7cf7db7aa79 | [
"BSD-3-Clause"
] | 1 | 2015-05-07T16:53:33.000Z | 2015-05-07T16:53:33.000Z | examples/neurospin/histogram_fits.py | fperez/nipy | 559f17150bd9fa8ead4fd088b330d7cf7db7aa79 | [
"BSD-3-Clause"
] | null | null | null | examples/neurospin/histogram_fits.py | fperez/nipy | 559f17150bd9fa8ead4fd088b330d7cf7db7aa79 | [
"BSD-3-Clause"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
__doc__ = \
"""
Example of a script that perfoms histogram analysis of an activation
image, to estimate activation Z-score with various heuristics:
* Gamma-Gaussian model
* Gaussian mixture model
... | 30.969388 | 80 | 0.629984 |
__doc__ = \
"""
Example of a script that perfoms histogram analysis of an activation
image, to estimate activation Z-score with various heuristics:
* Gamma-Gaussian model
* Gaussian mixture model
* Empirical normal null
This example is based on a (simplistic) simulated image.
"""
print __doc__
import num... | false | true |
1c45f11c3e11537796edf6b58ae0fb0bad91f88e | 10,785 | py | Python | code/scene.py | NoOneZero/coppelia | 14f589b361025506bf1dc2733edc5cf3ce27f45a | [
"Apache-2.0"
] | 1 | 2021-01-09T20:14:11.000Z | 2021-01-09T20:14:11.000Z | code/scene.py | NoOneZero/coppelia | 14f589b361025506bf1dc2733edc5cf3ce27f45a | [
"Apache-2.0"
] | null | null | null | code/scene.py | NoOneZero/coppelia | 14f589b361025506bf1dc2733edc5cf3ce27f45a | [
"Apache-2.0"
] | null | null | null | from code.character import Character
from code.spider import Spider
from code.neuro import Neuro
from code.excel import ExcelManager
from code.csv_manager import CscManager
import b0RemoteApi
import code.config as config
import time
from random import choices
import random
class Scene:
def __init__(self):
... | 41.964981 | 117 | 0.590357 | from code.character import Character
from code.spider import Spider
from code.neuro import Neuro
from code.excel import ExcelManager
from code.csv_manager import CscManager
import b0RemoteApi
import code.config as config
import time
from random import choices
import random
class Scene:
def __init__(self):
... | true | true |
1c45f2188bc7857583ffee040cd434578399dbd7 | 24,516 | py | Python | modules/webgrid2.py | dedebf/trilhas-poeticas-web2py-application | 61b28a60143a8bdce84a9fd8511f6b4504a34f33 | [
"MIT"
] | null | null | null | modules/webgrid2.py | dedebf/trilhas-poeticas-web2py-application | 61b28a60143a8bdce84a9fd8511f6b4504a34f33 | [
"MIT"
] | null | null | null | modules/webgrid2.py | dedebf/trilhas-poeticas-web2py-application | 61b28a60143a8bdce84a9fd8511f6b4504a34f33 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
WebGrid for web2py
Developed by Nathan Freeze (Copyright � 2009)
Email <nathan@freezable.com>
License: GPL v2
This file contains code to build a table that supports
paging, sorting, editing and totals.
"""
##################-----WEBGRID2 CRIADO... | 45.653631 | 132 | 0.465206 |
=value
self.filter_items_query = lambda field: field['id'] > 0
self.filter_cache = None
self.total_function = lambda fieldvalues: sum(fieldvalues)
def get_header(self, c):
try:
return self.field_headers[self.fields.index(c)]
except:
return c
... | true | true |
1c45f5a3f7513812d906fa04e329c3a1e9236159 | 1,065 | py | Python | edmunds/foundation/concerns/serviceproviders.py | LowieHuyghe/edmunds-python | 236d087746cb8802a8854b2706b8d3ff009e9209 | [
"Apache-2.0"
] | 4 | 2017-09-07T13:39:50.000Z | 2018-05-31T16:14:50.000Z | edmunds/foundation/concerns/serviceproviders.py | LowieHuyghe/edmunds-python | 236d087746cb8802a8854b2706b8d3ff009e9209 | [
"Apache-2.0"
] | 103 | 2017-03-19T15:58:21.000Z | 2018-07-11T20:36:17.000Z | edmunds/foundation/concerns/serviceproviders.py | LowieHuyghe/edmunds-python | 236d087746cb8802a8854b2706b8d3ff009e9209 | [
"Apache-2.0"
] | 2 | 2017-10-14T15:20:11.000Z | 2018-04-20T09:55:44.000Z |
from threading import Lock
class ServiceProviders(object):
"""
This class concerns service providers code for Application to extend from
"""
def register(self, class_):
"""
Register a Service Provider
:param class_: The class of the provider
:type class_: ServicePr... | 28.783784 | 77 | 0.629108 |
from threading import Lock
class ServiceProviders(object):
def register(self, class_):
lock_key = 'edmunds.serviceprovider.lock'
providers_key = 'edmunds.serviceprovider.providers'
if lock_key not in self.extensions:
self.extensions[lock_key] = Lock()
... | true | true |
1c45f686a688b7c613282c5f90a0c54d646b4457 | 4,988 | py | Python | mmdet/distillation/distillers/csd_distiller.py | Senwang98/Lightweight-Detection-and-KD | 7d6a4c02d922d4ed0920c9108f1f06dd63c5e90b | [
"Apache-2.0"
] | 8 | 2021-12-28T02:47:16.000Z | 2022-03-28T13:13:49.000Z | mmdet/distillation/distillers/csd_distiller.py | Senwang98/Lightweight-Detection-and-KD | 7d6a4c02d922d4ed0920c9108f1f06dd63c5e90b | [
"Apache-2.0"
] | 1 | 2022-03-29T10:52:49.000Z | 2022-03-31T01:28:01.000Z | mmdet/distillation/distillers/csd_distiller.py | Senwang98/Lightweight-Detection-and-KD | 7d6a4c02d922d4ed0920c9108f1f06dd63c5e90b | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
import torch.nn.functional as F
import torch
from mmdet.models.detectors.base import BaseDetector
from mmdet.models import build_detector
from mmcv.runner import load_checkpoint, _load_checkpoint, load_state_dict
from ..builder import DISTILLER, build_distill_loss
from collections import OrderedDi... | 38.666667 | 104 | 0.621893 | import torch.nn as nn
import torch.nn.functional as F
import torch
from mmdet.models.detectors.base import BaseDetector
from mmdet.models import build_detector
from mmcv.runner import load_checkpoint, _load_checkpoint, load_state_dict
from ..builder import DISTILLER, build_distill_loss
from collections import OrderedDi... | true | true |
1c45f6fcf56f16cac02a648a17e1f72c3d8a6b99 | 270 | py | Python | tests/basics/bytearray_construct.py | peterson79/pycom-micropython-sigfox | 3f93fc2c02567c96f18cff4af9125db8fd7a6fb4 | [
"MIT"
] | 37 | 2017-12-07T15:49:29.000Z | 2022-03-16T16:01:38.000Z | tests/basics/bytearray_construct.py | peterson79/pycom-micropython-sigfox | 3f93fc2c02567c96f18cff4af9125db8fd7a6fb4 | [
"MIT"
] | 27 | 2015-01-02T16:17:37.000Z | 2015-09-07T19:21:26.000Z | tests/basics/bytearray_construct.py | peterson79/pycom-micropython-sigfox | 3f93fc2c02567c96f18cff4af9125db8fd7a6fb4 | [
"MIT"
] | 22 | 2016-08-01T01:35:30.000Z | 2022-03-22T18:12:23.000Z | # test construction of bytearray from different objects
from array import array
# bytes, tuple, list
print(bytearray(b'123'))
print(bytearray((1, 2)))
print(bytearray([1, 2]))
# arrays
print(bytearray(array('b', [1, 2])))
print(bytearray(array('h', [0x101, 0x202])))
| 20.769231 | 55 | 0.7 |
from array import array
print(bytearray(b'123'))
print(bytearray((1, 2)))
print(bytearray([1, 2]))
print(bytearray(array('b', [1, 2])))
print(bytearray(array('h', [0x101, 0x202])))
| true | true |
1c45fb3f361b4037f9e9310bf53c677582ab3001 | 2,473 | py | Python | boto/pyami/startup.py | rectalogic/boto | 1ac79d0c984bfd83f26e7c3af4877a731a63ecc2 | [
"MIT"
] | 1 | 2019-06-22T23:31:13.000Z | 2019-06-22T23:31:13.000Z | boto/pyami/startup.py | rectalogic/boto | 1ac79d0c984bfd83f26e7c3af4877a731a63ecc2 | [
"MIT"
] | null | null | null | boto/pyami/startup.py | rectalogic/boto | 1ac79d0c984bfd83f26e7c3af4877a731a63ecc2 | [
"MIT"
] | null | null | null | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# 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 the rights to use, copy, modi... | 40.540984 | 103 | 0.630004 |
import sys
import boto
from boto.utils import find_class
from boto import config
from boto.pyami.scriptbase import ScriptBase
class Startup(ScriptBase):
def run_scripts(self):
scripts = config.get('Pyami', 'scripts')
if scripts:
for script in scripts.split(','):
... | true | true |
1c45fb42c9cea7abcaef7ad6b5250326ab3d502e | 73,700 | py | Python | ambassador/tests/t_tls.py | jhsiaomei/ambassador | c2726366612e31b74c177329f51265b5ad0f8df7 | [
"Apache-2.0"
] | null | null | null | ambassador/tests/t_tls.py | jhsiaomei/ambassador | c2726366612e31b74c177329f51265b5ad0f8df7 | [
"Apache-2.0"
] | null | null | null | ambassador/tests/t_tls.py | jhsiaomei/ambassador | c2726366612e31b74c177329f51265b5ad0f8df7 | [
"Apache-2.0"
] | null | null | null | from kat.harness import Query
from abstract_tests import AmbassadorTest, HTTP, ServiceType
class TLSContextsTest(AmbassadorTest):
"""
This test makes sure that TLS is not turned on when it's not intended to. For example, when an 'upstream'
TLS configuration is passed, the port is not supposed to switch t... | 76.136364 | 2,291 | 0.859824 | from kat.harness import Query
from abstract_tests import AmbassadorTest, HTTP, ServiceType
class TLSContextsTest(AmbassadorTest):
def init(self):
self.target = HTTP()
def manifests(self) -> str:
return super().manifests() + """
---
apiVersion: v1
metadata:
name: test-tlscontexts-secret
... | true | true |
1c45fc1d3bc956ee5253c530f021440b4f006f32 | 45,154 | py | Python | hangups/ui/__main__.py | zetorian/hangups | 60715702fc23842a94c8d13e144a8bd0ce45654a | [
"MIT"
] | null | null | null | hangups/ui/__main__.py | zetorian/hangups | 60715702fc23842a94c8d13e144a8bd0ce45654a | [
"MIT"
] | null | null | null | hangups/ui/__main__.py | zetorian/hangups | 60715702fc23842a94c8d13e144a8bd0ce45654a | [
"MIT"
] | null | null | null | """Reference chat client for hangups."""
import appdirs
import asyncio
import configargparse
import contextlib
import logging
import os
import sys
import urwid
import readlike
import hangups
from hangups.ui.emoticon import replace_emoticons
from hangups.ui import notifier
from hangups.ui.utils import get_conv_name, a... | 39.094372 | 79 | 0.607477 |
import appdirs
import asyncio
import configargparse
import contextlib
import logging
import os
import sys
import urwid
import readlike
import hangups
from hangups.ui.emoticon import replace_emoticons
from hangups.ui import notifier
from hangups.ui.utils import get_conv_name, add_color_to_scheme
rwid.__version__ ==... | true | true |
1c45fd021187544fbd3336d5d553e7bcdc31d6de | 2,477 | py | Python | ANPR.py | itcthienkhiem/myANPR | e0a76b2165d539c6a38f51f7485f37349a85a074 | [
"Apache-2.0"
] | null | null | null | ANPR.py | itcthienkhiem/myANPR | e0a76b2165d539c6a38f51f7485f37349a85a074 | [
"Apache-2.0"
] | null | null | null | ANPR.py | itcthienkhiem/myANPR | e0a76b2165d539c6a38f51f7485f37349a85a074 | [
"Apache-2.0"
] | null | null | null |
try:
import cv2
except ImportError:
print ("You must have OpenCV installed")
import matplotlib.pyplot as plt
import numpy as np
#Image(filename='../../../data/ANPR/sample_plates.png')
def showfig(image, ucmap):
#There is a difference in pixel ordering in OpenCV and Matplotlib.
#OpenCV fol... | 31.75641 | 88 | 0.669762 |
try:
import cv2
except ImportError:
print ("You must have OpenCV installed")
import matplotlib.pyplot as plt
import numpy as np
def showfig(image, ucmap):
if len(image.shape)==3 :
b,g,r = cv2.split(image)
image = cv2.merge([r,g,b])
imgplot=plt.imshow(... | true | true |
1c45fe0df1db49b180b71b556b709af501dbc80c | 86 | py | Python | tests/profiling/wrong_program_gevent.py | mykytarudenko/new-project | e06a912382239739dd3f93b54d545b9506102372 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/profiling/wrong_program_gevent.py | mykytarudenko/new-project | e06a912382239739dd3f93b54d545b9506102372 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2021-01-27T04:53:24.000Z | 2021-01-27T04:53:24.000Z | tests/profiling/wrong_program_gevent.py | mykytarudenko/new-project | e06a912382239739dd3f93b54d545b9506102372 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | from gevent import monkey
import ddtrace.profiling.auto # noqa
monkey.patch_all()
| 12.285714 | 37 | 0.77907 | from gevent import monkey
import ddtrace.profiling.auto
monkey.patch_all()
| true | true |
1c45fe43ea64a09d9242eb97f7af409854244804 | 10,694 | py | Python | readers.py | ankitshah009/youtube-8m-1 | a0f28c9ca05b72ca709322f2c4871a4345a69fbb | [
"Apache-2.0"
] | 2 | 2018-09-15T04:14:28.000Z | 2019-02-14T02:35:55.000Z | readers.py | ankitshah009/youtube-8m-1 | a0f28c9ca05b72ca709322f2c4871a4345a69fbb | [
"Apache-2.0"
] | null | null | null | readers.py | ankitshah009/youtube-8m-1 | a0f28c9ca05b72ca709322f2c4871a4345a69fbb | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 37.921986 | 101 | 0.696559 |
import tensorflow as tf
try:
from . import utils
except ImportError:
import utils
from tensorflow import logging
def resize_axis(tensor, axis, new_size, fill_value=0):
tensor = tf.convert_to_tensor(tensor)
shape = tf.unstack(tf.shape(tensor))
pad_shape = shape[:]
pad_shape[ax... | true | true |
1c45ffd929e7bc233ccb8e5fdcdba952ce40321b | 6,303 | py | Python | userbot/plugins/updater.py | kumar451/CatUserbot | 44fab853232fad163fee63565cc4f3e645596527 | [
"MIT"
] | null | null | null | userbot/plugins/updater.py | kumar451/CatUserbot | 44fab853232fad163fee63565cc4f3e645596527 | [
"MIT"
] | null | null | null | userbot/plugins/updater.py | kumar451/CatUserbot | 44fab853232fad163fee63565cc4f3e645596527 | [
"MIT"
] | null | null | null | """Update UserBot code (for Xtra-Telegram)
Syntax: .update
\nAll Credits goes to © @Three_Cube_TeKnoways
\nFor this awasome plugin.\nPorted from PpaperPlane Extended"""
from os import remove, execle, path, makedirs, getenv, environ,execl
from shutil import rmtree
import asyncio
import sys
from git import Repo
from git... | 38.2 | 136 | 0.618912 |
from os import remove, execle, path, makedirs, getenv, environ,execl
from shutil import rmtree
import asyncio
import sys
from git import Repo
from git.exc import GitCommandError, InvalidGitRepositoryError, NoSuchPathError
from userbot import CMD_HELP, bot
from userbot.utils import admin_cmd
UPSTREAM_REPO_URL = "https... | true | true |
1c460171229eb1de0dd2daccc2cae4a857668e41 | 6,051 | py | Python | util.py | bbitarello/ldpred | b84b99f23dc83dc164300b8dee6678207461a751 | [
"MIT"
] | 89 | 2016-06-03T14:31:21.000Z | 2022-02-22T02:15:45.000Z | util.py | bbitarello/ldpred | b84b99f23dc83dc164300b8dee6678207461a751 | [
"MIT"
] | 143 | 2016-08-10T14:06:53.000Z | 2021-07-04T10:29:26.000Z | util.py | bbitarello/ldpred | b84b99f23dc83dc164300b8dee6678207461a751 | [
"MIT"
] | 68 | 2016-08-05T14:56:39.000Z | 2021-12-10T15:43:35.000Z | """
Various general utility functions.
"""
import scipy as sp
from scipy import stats
import pickle
import gzip
import os
from itertools import takewhile
from itertools import repeat
import sys
import re
# LDpred currently ignores the Y and MT chromosomes.
ok_chromosomes = set(range(1, 24))
chromosomes_list = ['chrom... | 27.013393 | 139 | 0.605354 | import scipy as sp
from scipy import stats
import pickle
import gzip
import os
from itertools import takewhile
from itertools import repeat
import sys
import re
ok_chromosomes = set(range(1, 24))
chromosomes_list = ['chrom_%d' % (chrom) for chrom in ok_chromosomes]
chrom_name_map = {'X':23,'chr_X':23,'chrom_X':23}
f... | true | true |
1c4601d6ca6b386fcd89245ffea8fedcc89875c1 | 2,924 | py | Python | test/functional/mempool_resurrect.py | patrykwnosuch/machinecoin-core | b6783c857f43f7f077de594d1e03d156f5295b9c | [
"MIT"
] | 1 | 2019-05-27T11:12:53.000Z | 2019-05-27T11:12:53.000Z | test/functional/mempool_resurrect.py | patrykwnosuch/machinecoin-core | b6783c857f43f7f077de594d1e03d156f5295b9c | [
"MIT"
] | null | null | null | test/functional/mempool_resurrect.py | patrykwnosuch/machinecoin-core | b6783c857f43f7f077de594d1e03d156f5295b9c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Machinecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test resurrection of mined transactions when the blockchain is re-organized."""
from test_framewor... | 41.183099 | 123 | 0.675103 |
from test_framework.blocktools import create_raw_transaction
from test_framework.test_framework import MachinecoinTestFramework
from test_framework.util import assert_equal
class MempoolCoinbaseTest(MachinecoinTestFramework):
def set_test_params(self):
self.num_nodes = 1
def skip_test_if_missing... | true | true |
1c4602bc2b8f35a6487314afa0547956c601bf34 | 3,032 | py | Python | estatisticas_facebook/users/migrations/0001_initial.py | danieldourado/estatisticas_facebook_django | 67274e647cf9e2261f1a7810cd9862a4040dfc06 | [
"MIT"
] | 2 | 2017-12-22T01:00:22.000Z | 2017-12-22T11:14:40.000Z | estatisticas_facebook/users/migrations/0001_initial.py | danieldourado/estatisticas_facebook_django | 67274e647cf9e2261f1a7810cd9862a4040dfc06 | [
"MIT"
] | 18 | 2017-12-14T12:04:45.000Z | 2022-03-11T23:23:05.000Z | estatisticas_facebook/users/migrations/0001_initial.py | danieldourado/estatisticas_facebook_django | 67274e647cf9e2261f1a7810cd9862a4040dfc06 | [
"MIT"
] | 1 | 2021-03-27T16:18:56.000Z | 2021-03-27T16:18:56.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-12-06 11:33
from __future__ import unicode_literals
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
... | 63.166667 | 329 | 0.662929 |
from __future__ import unicode_literals
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0008_alter_user_username_max_lengt... | true | true |
1c460421d2d07bef9ca1d09f5ba7710449101a3e | 689 | py | Python | battleships/managers/GameOver.py | wkta/Python-Bataille-Navale | b6f725519cf1cf559e60ec766aa4f059463b1493 | [
"MIT"
] | null | null | null | battleships/managers/GameOver.py | wkta/Python-Bataille-Navale | b6f725519cf1cf559e60ec766aa4f059463b1493 | [
"MIT"
] | null | null | null | battleships/managers/GameOver.py | wkta/Python-Bataille-Navale | b6f725519cf1cf559e60ec766aa4f059463b1493 | [
"MIT"
] | 1 | 2019-12-03T15:42:38.000Z | 2019-12-03T15:42:38.000Z | # Copyright © 2019 CAILLAUD Jean-Baptiste.
# import the engine.
import engine
class GameOver(engine.LevelManager):
"""
Renders the game over screen.
"""
def begin(self):
# Add the close handler.
engine.Engine.input_handler.add_listener(engine.CloseOnEscapeOrQuit())
# Create... | 26.5 | 86 | 0.596517 |
import engine
class GameOver(engine.LevelManager):
def begin(self):
engine.Engine.input_handler.add_listener(engine.CloseOnEscapeOrQuit())
text = engine.TextGameObject(
engine.Engine.scene,
"Futura",
48,
"You won !" if engine.E... | true | true |
1c460473d11c959ddd81ee921f32596dbd8e1e9e | 754 | py | Python | snakewatch/action/__init__.py | asoc/snakewatch | 347b94e0ca59cdb309a6950fa3b5464c8d0081f8 | [
"BSD-3-Clause"
] | null | null | null | snakewatch/action/__init__.py | asoc/snakewatch | 347b94e0ca59cdb309a6950fa3b5464c8d0081f8 | [
"BSD-3-Clause"
] | null | null | null | snakewatch/action/__init__.py | asoc/snakewatch | 347b94e0ca59cdb309a6950fa3b5464c8d0081f8 | [
"BSD-3-Clause"
] | null | null | null | """
This file is part of snakewatch.
snakewatch is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
snakewatch is distributed in the hop... | 37.7 | 82 | 0.795756 |
from __future__ import print_function, absolute_import, unicode_literals, division
| true | true |
1c4604bd0cd7e6cda5fbccf019cd6209998f11b6 | 2,134 | py | Python | tests/unit/pypyr/parser/jsonfile_test.py | pypyr/pypyr-cli | dc0f694ac0c0e3c2844c1a20788c9af586a8a16e | [
"Apache-2.0"
] | 31 | 2017-03-24T11:27:34.000Z | 2020-05-27T20:06:28.000Z | tests/unit/pypyr/parser/jsonfile_test.py | pypyr/pypyr-cli | dc0f694ac0c0e3c2844c1a20788c9af586a8a16e | [
"Apache-2.0"
] | 89 | 2017-04-12T09:50:32.000Z | 2020-08-13T13:18:36.000Z | tests/unit/pypyr/parser/jsonfile_test.py | pypyr/pypyr-cli | dc0f694ac0c0e3c2844c1a20788c9af586a8a16e | [
"Apache-2.0"
] | 6 | 2017-06-04T14:19:59.000Z | 2020-02-10T13:16:40.000Z | """jsonfile.py unit tests."""
from unittest.mock import patch
import pytest
import pypyr.parser.jsonfile
def test_json_file_open_fails_on_arbitrary_string():
"""Non path-y input string should fail."""
with pytest.raises(FileNotFoundError):
pypyr.parser.jsonfile.get_parsed_context('value 1,value 2, v... | 31.850746 | 75 | 0.679944 | from unittest.mock import patch
import pytest
import pypyr.parser.jsonfile
def test_json_file_open_fails_on_arbitrary_string():
with pytest.raises(FileNotFoundError):
pypyr.parser.jsonfile.get_parsed_context('value 1,value 2, value3')
def test_json_file_open_fails_on_empty_string():
with pytest.ra... | true | true |
1c46065a2d7cec80d32a5396991fd1b74b074e66 | 8,727 | py | Python | syncflux.py | nagylzs/syncflux | c070267065cad817708d0680e17bfe5f8942310f | [
"Apache-2.0"
] | null | null | null | syncflux.py | nagylzs/syncflux | c070267065cad817708d0680e17bfe5f8942310f | [
"Apache-2.0"
] | null | null | null | syncflux.py | nagylzs/syncflux | c070267065cad817708d0680e17bfe5f8942310f | [
"Apache-2.0"
] | null | null | null | import copy
import datetime
import sys
import os
import time
import argparse
import traceback
import pytz
import syncthing
from influxdb import InfluxDBClient
import yaml
from yaml2dataclass import Schema, SchemaPath
from typing import Optional, Dict, Type, List
from dataclasses import dataclass, asdict, field
@dat... | 33.694981 | 119 | 0.605936 | import copy
import datetime
import sys
import os
import time
import argparse
import traceback
import pytz
import syncthing
from influxdb import InfluxDBClient
import yaml
from yaml2dataclass import Schema, SchemaPath
from typing import Optional, Dict, Type, List
from dataclasses import dataclass, asdict, field
@dat... | true | true |
1c46086c638aabe3f56e864c3f814d7d84d20949 | 9,687 | py | Python | lib/spack/spack/build_systems/cuda.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | lib/spack/spack/build_systems/cuda.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2022-02-28T11:32:57.000Z | 2022-03-02T11:37:37.000Z | lib/spack/spack/build_systems/cuda.py | varioustoxins/spack | cab0e4cb240f34891a6d753f3393e512f9a99e9a | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import spack.variant
from spack.directives import conflicts, depends_on, variant
from spack.multimethod import when
from s... | 50.19171 | 92 | 0.617425 |
import spack.variant
from spack.directives import conflicts, depends_on, variant
from spack.multimethod import when
from spack.package import PackageBase
class CudaPackage(PackageBase):
= (
'10', '11', '12', '13',
'20', '21',
'30', '32', '35', '37',
'50', '52', '53',
... | true | true |
1c460873137198c0c9f2771d470c8e55b0d5da3b | 33 | py | Python | step2.py | SirLonsevrot/Lesson_20.11.28 | eac91b46441bf641c60d7f5d1340d74f8665614b | [
"Apache-2.0"
] | null | null | null | step2.py | SirLonsevrot/Lesson_20.11.28 | eac91b46441bf641c60d7f5d1340d74f8665614b | [
"Apache-2.0"
] | null | null | null | step2.py | SirLonsevrot/Lesson_20.11.28 | eac91b46441bf641c60d7f5d1340d74f8665614b | [
"Apache-2.0"
] | null | null | null | print('Георгий ничего не умеет')
| 16.5 | 32 | 0.757576 | print('Георгий ничего не умеет')
| true | true |
1c4608abdf6f6b3a4ea765ffc6252d1d214de3d1 | 6,003 | py | Python | pro/views.py | iyerikuzwe/Award | a5ac352a7d05d23c92167022e00648caeab62590 | [
"Unlicense"
] | null | null | null | pro/views.py | iyerikuzwe/Award | a5ac352a7d05d23c92167022e00648caeab62590 | [
"Unlicense"
] | null | null | null | pro/views.py | iyerikuzwe/Award | a5ac352a7d05d23c92167022e00648caeab62590 | [
"Unlicense"
] | null | null | null | from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from .forms import ProjectForm, ProfileForm, DesignForm, ContentForm, UsabilityForm
from .models import Project, Profile
from django.contrib.auth.models import... | 33.35 | 91 | 0.666167 | from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from .forms import ProjectForm, ProfileForm, DesignForm, ContentForm, UsabilityForm
from .models import Project, Profile
from django.contrib.auth.models import... | true | true |
1c46098610964543336f1caf9a6c92cb98615a0c | 5,335 | py | Python | example/distill/nlp/reader.py | wangxicoding/edl | 75d651e72e5297aba2e597588cf958ea336deb4e | [
"Apache-2.0"
] | 90 | 2020-04-21T01:46:10.000Z | 2022-02-10T09:09:34.000Z | example/distill/nlp/reader.py | wangxicoding/edl | 75d651e72e5297aba2e597588cf958ea336deb4e | [
"Apache-2.0"
] | 37 | 2018-03-02T22:41:15.000Z | 2020-04-22T16:48:36.000Z | example/distill/nlp/reader.py | wangxicoding/edl | 75d651e72e5297aba2e597588cf958ea336deb4e | [
"Apache-2.0"
] | 34 | 2018-03-02T23:28:25.000Z | 2020-03-25T08:50:29.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 30.485714 | 78 | 0.530834 |
import codecs
import os
import csv
import sys
from paddlehub.dataset import InputExample
from paddlehub.common.dir import DATA_HOME
from paddlehub.dataset.base_nlp_dataset import BaseNLPDataset
import paddle as P
import paddle.fluid.dygraph as D
import numpy as np
def space_tokenizer(i):
return i.s... | true | true |
1c460c1837c4e7c5359fc82cd3f26054a7ebdf50 | 179 | py | Python | needle/engines/base.py | VICEMedia/needle | c2d28ee07278f1d0bd7ace6a2cb65cfea24f2a7e | [
"BSD-3-Clause"
] | 144 | 2017-04-23T08:52:52.000Z | 2022-03-15T03:40:37.000Z | new_pytest_needle/engines/base.py | Gadzillion/new_pytest_needle | b86de146c443a8377cfab9750aff187c0cb0852d | [
"MIT"
] | 35 | 2015-01-16T15:24:35.000Z | 2017-04-02T22:35:05.000Z | new_pytest_needle/engines/base.py | Gadzillion/new_pytest_needle | b86de146c443a8377cfab9750aff187c0cb0852d | [
"MIT"
] | 24 | 2017-04-23T08:52:57.000Z | 2022-02-02T11:57:21.000Z | class EngineBase(object):
"""
Base class for diff engines.
"""
def assertSameFiles(self, output_file, baseline_file, threshold):
raise NotImplementedError | 25.571429 | 69 | 0.687151 | class EngineBase(object):
def assertSameFiles(self, output_file, baseline_file, threshold):
raise NotImplementedError | true | true |
1c460c5310e4d551ba33a840648e9aabd577f049 | 1,077 | py | Python | ESEC.FSE.2017.Experimental.Replication/Figure1/Table1GroupScore.py | austinatchley/Themis | 67d5e639e9445f1612249ae7939b3625fea138db | [
"BSD-4-Clause-UC"
] | 88 | 2017-08-14T19:44:21.000Z | 2021-11-20T00:48:01.000Z | ESEC.FSE.2017.Experimental.Replication/Figure1/Table1GroupScore.py | kavithacd/Themis | 67d5e639e9445f1612249ae7939b3625fea138db | [
"BSD-4-Clause-UC"
] | 25 | 2017-03-07T15:33:46.000Z | 2020-06-18T01:39:26.000Z | ESEC.FSE.2017.Experimental.Replication/Figure1/Table1GroupScore.py | kavithacd/Themis | 67d5e639e9445f1612249ae7939b3625fea138db | [
"BSD-4-Clause-UC"
] | 19 | 2017-10-11T15:25:12.000Z | 2021-08-16T01:47:43.000Z | '''
This script calculates the Group discrimination score for the particular input file towards race or gender.
USAGE :
argv[1] : Input test suite
argv[2] : 0/1
0 for tace
1 for gender
'''
import sys
f = open(sys.argv[1],"r")
type = int(sys.argv[2])
#type = 0 means race
#type ... | 18.894737 | 107 | 0.499536 | '''
This script calculates the Group discrimination score for the particular input file towards race or gender.
USAGE :
argv[1] : Input test suite
argv[2] : 0/1
0 for tace
1 for gender
'''
import sys
f = open(sys.argv[1],"r")
type = int(sys.argv[2])
if(type==0):
pos = [... | false | true |
1c460cfe2369acdf089542529e5400b016579622 | 4,298 | py | Python | temboo/core/Library/LastFm/Artist/GetTopTracks.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 7 | 2016-03-07T02:07:21.000Z | 2022-01-21T02:22:41.000Z | temboo/core/Library/LastFm/Artist/GetTopTracks.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | null | null | null | temboo/core/Library/LastFm/Artist/GetTopTracks.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 8 | 2016-06-14T06:01:11.000Z | 2020-04-22T09:21:44.000Z | # -*- coding: utf-8 -*-
###############################################################################
#
# GetTopTracks
# Retrieves the top tracks by an artist on Last.fm, ordered by popularity.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "... | 39.796296 | 221 | 0.676826 | true | true | |
1c460e435bc0e519d5da56e295c2516fae50f58a | 2,381 | py | Python | pgmpy/exceptions/Exceptions.py | NunoEdgarGFlowHub/pgmpy | ac0ecc8f5bdd14999c386c6b00a3ce77407b83ce | [
"MIT"
] | 1 | 2016-08-27T18:30:57.000Z | 2016-08-27T18:30:57.000Z | pgmpy/exceptions/Exceptions.py | NunoEdgarGFlowHub/pgmpy | ac0ecc8f5bdd14999c386c6b00a3ce77407b83ce | [
"MIT"
] | null | null | null | pgmpy/exceptions/Exceptions.py | NunoEdgarGFlowHub/pgmpy | ac0ecc8f5bdd14999c386c6b00a3ce77407b83ce | [
"MIT"
] | 1 | 2016-08-27T18:31:00.000Z | 2016-08-27T18:31:00.000Z | #!/usr/bin/env python3
"""Contains all the user-defined exceptions created for PgmPy"""
class MissingParentsError(Exception):
def __init__(self, *missing):
self.missing = missing
def __str__(self):
return repr("Parents are missing: " + str(self.missing))
class ExtraParentsError(Exception):
... | 20.704348 | 68 | 0.642167 |
class MissingParentsError(Exception):
def __init__(self, *missing):
self.missing = missing
def __str__(self):
return repr("Parents are missing: " + str(self.missing))
class ExtraParentsError(Exception):
def __init__(self, *extra):
self.extra = extra
def __str__(self):
... | true | true |
1c460e9948c0b105e16e3c6be296155958f589a9 | 2,555 | py | Python | only_common.py | taotaotao3/only_common | 7dd3700d4bf3935c193b0b6f38a0dafa750ad01c | [
"MIT"
] | null | null | null | only_common.py | taotaotao3/only_common | 7dd3700d4bf3935c193b0b6f38a0dafa750ad01c | [
"MIT"
] | null | null | null | only_common.py | taotaotao3/only_common | 7dd3700d4bf3935c193b0b6f38a0dafa750ad01c | [
"MIT"
] | null | null | null | import sys
import io
import csv
import pprint
import pandas as pd
import pdb
def excommon(arg_1 = 'a.csv', arg_2 = 'b.csv', arg_3 = 'shift-jis'):
print('sys.argv[1]:', arg_1)
print('sys.argv[2]:', arg_2)
print('sys.argv[3]:', arg_3)
df_a = pd.read_csv(arg_1, encoding=arg_3, header=None)
list_a = [... | 37.573529 | 115 | 0.535812 | import sys
import io
import csv
import pprint
import pandas as pd
import pdb
def excommon(arg_1 = 'a.csv', arg_2 = 'b.csv', arg_3 = 'shift-jis'):
print('sys.argv[1]:', arg_1)
print('sys.argv[2]:', arg_2)
print('sys.argv[3]:', arg_3)
df_a = pd.read_csv(arg_1, encoding=arg_3, header=None)
list_a = [... | true | true |
1c460f108d2d697a791df8a9c61f73dfc9837a9b | 2,840 | py | Python | test/functional/test_framework/address.py | IDC-Group/VHKD | 0256ddf1477439ebc84e97132d3673aa61c39b73 | [
"MIT"
] | 3 | 2018-06-23T10:04:45.000Z | 2018-06-25T02:22:01.000Z | test/functional/test_framework/address.py | IDC-Group/VHKD | 0256ddf1477439ebc84e97132d3673aa61c39b73 | [
"MIT"
] | null | null | null | test/functional/test_framework/address.py | IDC-Group/VHKD | 0256ddf1477439ebc84e97132d3673aa61c39b73 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016 The vhkdCoin Core vhkd
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Encode and decode BASE58, P2PKH and P2SH addresses."""
from .script import hash256, hash160, sha256, CScript, OP... | 32.272727 | 73 | 0.68662 |
from .script import hash256, hash160, sha256, CScript, OP_0
from .util import bytes_to_hex_str, hex_str_to_bytes
from . import segwit_addr
chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
def byte_to_base58(b, version):
result = ''
str = bytes_to_hex_str(b)
str = bytes_to_hex_str... | true | true |
1c460f4074ead61f00745adb8067544b72ddcdf8 | 7,593 | py | Python | tensor2tensor/rl/envs/simulated_batch_env.py | akshitj1/tensor2tensor | a76b0f0afe24c966e26d0112356eb66f5a8a37aa | [
"Apache-2.0"
] | 1 | 2022-03-25T03:07:28.000Z | 2022-03-25T03:07:28.000Z | tensor2tensor/rl/envs/simulated_batch_env.py | akshitj1/tensor2tensor | a76b0f0afe24c966e26d0112356eb66f5a8a37aa | [
"Apache-2.0"
] | 1 | 2022-01-05T06:08:00.000Z | 2022-01-05T06:08:29.000Z | tensor2tensor/rl/envs/simulated_batch_env.py | akshitj1/tensor2tensor | a76b0f0afe24c966e26d0112356eb66f5a8a37aa | [
"Apache-2.0"
] | 1 | 2021-07-15T07:25:08.000Z | 2021-07-15T07:25:08.000Z | # coding=utf-8
# Copyright 2018 The Tensor2Tensor 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... | 40.388298 | 85 | 0.703148 |
# https://github.com/tensorflow/agents/blob/master/agents/tools/in_graph_batch_env.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensor2tensor.layers import common_layers
from tensor2tensor.rl.envs import in_graph_batch_env
from ten... | true | true |
1c461034d0e13519aa62b7aed184a164629d184b | 4,234 | py | Python | scripts/py_featextr_server/wordembed_cosine_server.py | MokriyYuriy/FlexNeuART | 49f13e3f9f0b0ea1399ea558436caaedd5233f5c | [
"Apache-2.0"
] | null | null | null | scripts/py_featextr_server/wordembed_cosine_server.py | MokriyYuriy/FlexNeuART | 49f13e3f9f0b0ea1399ea558436caaedd5233f5c | [
"Apache-2.0"
] | null | null | null | scripts/py_featextr_server/wordembed_cosine_server.py | MokriyYuriy/FlexNeuART | 49f13e3f9f0b0ea1399ea558436caaedd5233f5c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sys
import argparse
sys.path.append('.')
from scripts.py_featextr_server.base_server import BaseQueryHandler, startQueryServer
import numpy as np
from scripts.py_featextr_server.utils import loadEmbeddings, createEmbedMap, robustCosineSimil
# Exclusive==True means that only one getScor... | 35.579832 | 95 | 0.593056 |
import sys
import argparse
sys.path.append('.')
from scripts.py_featextr_server.base_server import BaseQueryHandler, startQueryServer
import numpy as np
from scripts.py_featextr_server.utils import loadEmbeddings, createEmbedMap, robustCosineSimil
class CosineSimilQueryHandler(BaseQueryHandler):
def __init_... | true | true |
1c4610361f88087ecacad48415ecb6f130687e52 | 409 | py | Python | XiuxiuService/AliSDK/top/api/rest/OpenimChatlogsGetRequest.py | nightHearter/XiuxiuService | 281c2d5eef85936edcd0d9ec97c8d165078f444c | [
"MIT"
] | null | null | null | XiuxiuService/AliSDK/top/api/rest/OpenimChatlogsGetRequest.py | nightHearter/XiuxiuService | 281c2d5eef85936edcd0d9ec97c8d165078f444c | [
"MIT"
] | null | null | null | XiuxiuService/AliSDK/top/api/rest/OpenimChatlogsGetRequest.py | nightHearter/XiuxiuService | 281c2d5eef85936edcd0d9ec97c8d165078f444c | [
"MIT"
] | null | null | null | '''
Created by auto_sdk on 2015.06.16
'''
from top.api.base import RestApi
class OpenimChatlogsGetRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.begin = None
self.count = None
self.end = None
self.next_key = None
self.user1 = Non... | 24.058824 | 56 | 0.696822 | from top.api.base import RestApi
class OpenimChatlogsGetRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.begin = None
self.count = None
self.end = None
self.next_key = None
self.user1 = None
self.user2 = None
def getapiname(sel... | true | true |
1c46117a8c4860a623124d64ceca53a37a0253a2 | 4,961 | py | Python | project/Code/video_stabilizer.py | OmerRe/video-processing-methods | 245a89aaa1e774a62da1f043058242841a4f53ee | [
"MIT"
] | 1 | 2022-03-23T13:07:28.000Z | 2022-03-23T13:07:28.000Z | project/Code/video_stabilizer.py | OmerRe/video-processing-methods | 245a89aaa1e774a62da1f043058242841a4f53ee | [
"MIT"
] | null | null | null | project/Code/video_stabilizer.py | OmerRe/video-processing-methods | 245a89aaa1e774a62da1f043058242841a4f53ee | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from Code.utils import fixBorder, convert_to_gray
def stabilize_video(video_frames: list, config: dict) -> list:
"""Creating a stabilized video from an arbitrary input video.
Args:
input_video: cv2.VideoCapture. Video we want to stabilize.
config: dict. Dictionary... | 45.513761 | 119 | 0.712961 | import cv2
import numpy as np
from Code.utils import fixBorder, convert_to_gray
def stabilize_video(video_frames: list, config: dict) -> list:
print("Starting Video Stabilization...")
transforms = find_motion_between_frames(config['video_params'], video_frames, config)
transforms_smooth = calc_smooth_tran... | true | true |
1c4612a1484861de5941c466421c93898e7ec41d | 347 | py | Python | dashboard/main.py | BOJIT/pi-dashboard | 134c3d7b941a470630aceed4e69b8735bcfcebfd | [
"MIT"
] | null | null | null | dashboard/main.py | BOJIT/pi-dashboard | 134c3d7b941a470630aceed4e69b8735bcfcebfd | [
"MIT"
] | null | null | null | dashboard/main.py | BOJIT/pi-dashboard | 134c3d7b941a470630aceed4e69b8735bcfcebfd | [
"MIT"
] | null | null | null | """
Copyright (c)
Author: James Bennion-Pedley
Date: 2021 - present
Licence: MIT
"""
# from dashboard import app
from flask import Blueprint, render_template
from flask_login import login_required, current_user
main = Blueprint('main', __name__)
# Home page
@main.route('/')
@login_required
def index():
return rend... | 16.52381 | 52 | 0.752161 |
from flask import Blueprint, render_template
from flask_login import login_required, current_user
main = Blueprint('main', __name__)
@main.route('/')
@login_required
def index():
return render_template('index.html')
| true | true |
1c461452d26499a8ba2aa4b2b235a47f6a1e796d | 5,474 | py | Python | project/S17-IO-3012/code/bin/benchmark_replicas_import.py | suunni/sp17-i524 | 42dd11b914c03c741dad8a8505c3e091dc6ec412 | [
"Apache-2.0"
] | 2 | 2020-10-30T09:54:25.000Z | 2021-12-14T19:13:18.000Z | project/S17-IO-3012/code/bin/benchmark_replicas_import.py | cloudmesh/sp17-i524 | 42dd11b914c03c741dad8a8505c3e091dc6ec412 | [
"Apache-2.0"
] | 98 | 2017-01-19T04:24:02.000Z | 2017-10-27T11:30:50.000Z | project/S17-IO-3012/code/bin/benchmark_replicas_import.py | cloudmesh/sp17-i524 | 42dd11b914c03c741dad8a8505c3e091dc6ec412 | [
"Apache-2.0"
] | 294 | 2017-01-09T13:18:39.000Z | 2018-07-13T01:32:24.000Z | import matplotlib.pyplot as plt
import sys
import pandas as pd
def get_parm():
"""retrieves mandatory parameter to program
@param: none
@type: n/a
"""
try:
return sys.argv[1]
except:
print ('Must enter file name as parameter')
exit()
def read_file(filename):
"""... | 38.013889 | 144 | 0.735842 | import matplotlib.pyplot as plt
import sys
import pandas as pd
def get_parm():
try:
return sys.argv[1]
except:
print ('Must enter file name as parameter')
exit()
def read_file(filename):
try:
return pd.read_csv(filename)
except:
print ('Error retrieving file')... | true | true |
1c461466a808f85ad09eb1de51759f22e737153d | 10,277 | py | Python | sdk/examples/intkey_python/dgt_intkey/client_cli/intkey_cli.py | DGT-Network/DGT-SDK | 3413ae22e79c13e71264271fa3f82203fd49f0b3 | [
"Apache-2.0"
] | null | null | null | sdk/examples/intkey_python/dgt_intkey/client_cli/intkey_cli.py | DGT-Network/DGT-SDK | 3413ae22e79c13e71264271fa3f82203fd49f0b3 | [
"Apache-2.0"
] | null | null | null | sdk/examples/intkey_python/dgt_intkey/client_cli/intkey_cli.py | DGT-Network/DGT-SDK | 3413ae22e79c13e71264271fa3f82203fd49f0b3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016, 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 26.763021 | 80 | 0.648827 |
import argparse
import getpass
import logging
import os
import sys
import traceback
import pkg_resources
from colorlog import ColoredFormatter
from dgt_intkey.client_cli.generate import add_generate_parser
from dgt_intkey.client_cli.generate import do_generate
from dgt_intkey.client_cli.populate import... | true | true |
1c46148594b66e51e3b670cc5e04060e21b3f2a6 | 1,581 | py | Python | test_config.py | AshishMittal/watson-stt-wer-python | 62dea234665aa5c11a05327e49419d27b87f1b25 | [
"Apache-2.0"
] | 3 | 2021-06-17T14:19:44.000Z | 2022-02-27T18:13:51.000Z | test_config.py | AshishMittal/watson-stt-wer-python | 62dea234665aa5c11a05327e49419d27b87f1b25 | [
"Apache-2.0"
] | 22 | 2021-06-04T13:18:10.000Z | 2022-02-11T21:55:45.000Z | test_config.py | AshishMittal/watson-stt-wer-python | 62dea234665aa5c11a05327e49419d27b87f1b25 | [
"Apache-2.0"
] | 2 | 2021-07-15T19:43:36.000Z | 2022-02-23T09:56:47.000Z | import unittest, os
from config import Config
def getInstance():
return Config('config.ini.sample')
class MyTest(unittest.TestCase):
def test_get_value(self):
c = getInstance()
self.assertEqual(c.getValue('SpeechToText','base_model_name'), 'en-US_NarrowbandModel')
def test_get_missing_se... | 33.638298 | 124 | 0.683112 | import unittest, os
from config import Config
def getInstance():
return Config('config.ini.sample')
class MyTest(unittest.TestCase):
def test_get_value(self):
c = getInstance()
self.assertEqual(c.getValue('SpeechToText','base_model_name'), 'en-US_NarrowbandModel')
def test_get_missing_se... | true | true |
1c4616639bab4e32664cf09fae71be8e8f78f138 | 1,117 | py | Python | ex6_yaml_json_write.py | ro8harp/pynet_test | 711ede69b43e42ae6c62f7224bd5a84dfc491d5e | [
"Apache-2.0"
] | null | null | null | ex6_yaml_json_write.py | ro8harp/pynet_test | 711ede69b43e42ae6c62f7224bd5a84dfc491d5e | [
"Apache-2.0"
] | null | null | null | ex6_yaml_json_write.py | ro8harp/pynet_test | 711ede69b43e42ae6c62f7224bd5a84dfc491d5e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env
,,,
Write a Python program that creates a list. One of the elements of the list
should be a dictionary with at least two keys. Write this list out to a file
using both YAML and JSON formats. The YAML file should be in the expanded form.
'''
import yaml
import json
def main():
,,,
Write a Python... | 23.765957 | 80 | 0.606088 |
,,,
Write a Python program that creates a list. One of the elements of the list
should be a dictionary with at least two keys. Write this list out to a file
using both YAML and JSON formats. The YAML file should be in the expanded form.
'''
import yaml
import json
def main():
,,,
Write a Python program that ... | false | true |
1c46168ec175c99047459da65d3253be700bc914 | 601 | py | Python | list/stack.py | Knight0xFF/Data-Structures | 2a3c20f21f0340b3ef10be520a0429f36e1fa60f | [
"MIT"
] | null | null | null | list/stack.py | Knight0xFF/Data-Structures | 2a3c20f21f0340b3ef10be520a0429f36e1fa60f | [
"MIT"
] | null | null | null | list/stack.py | Knight0xFF/Data-Structures | 2a3c20f21f0340b3ef10be520a0429f36e1fa60f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
class Stack(object):
def __init__(self):
self.items = []
def push(self, item):
return self.items.append(item)
def pop(self):
return self.items.pop()
def peek(self):
return self.items[len(self.items) - 1]
def get_size... | 18.78125 | 46 | 0.579035 |
class Stack(object):
def __init__(self):
self.items = []
def push(self, item):
return self.items.append(item)
def pop(self):
return self.items.pop()
def peek(self):
return self.items[len(self.items) - 1]
def get_size(self):
return len(self.items)
... | false | true |
1c46177306b899ada2c53a4c9fa5cec25807641b | 12,569 | py | Python | harmonica/equivalent_layer/harmonic_spherical.py | RichardScottOZ/harmonica | ccb0437ea0ed528cfd144844edab98141c8d08da | [
"BSD-3-Clause"
] | null | null | null | harmonica/equivalent_layer/harmonic_spherical.py | RichardScottOZ/harmonica | ccb0437ea0ed528cfd144844edab98141c8d08da | [
"BSD-3-Clause"
] | 1 | 2022-01-19T03:02:22.000Z | 2022-01-19T20:47:19.000Z | harmonica/equivalent_layer/harmonic_spherical.py | RichardScottOZ/harmonica | ccb0437ea0ed528cfd144844edab98141c8d08da | [
"BSD-3-Clause"
] | 1 | 2022-01-17T23:15:18.000Z | 2022-01-17T23:15:18.000Z | """
Equivalent layer for generic harmonic functions in spherical coordinates
"""
import numpy as np
from numba import jit
from sklearn.utils.validation import check_is_fitted
import verde as vd
import verde.base as vdb
from .utils import jacobian_numba, predict_numba, pop_extra_coords
from ..forward.utils import dista... | 36.32659 | 86 | 0.626701 | import numpy as np
from numba import jit
from sklearn.utils.validation import check_is_fitted
import verde as vd
import verde.base as vdb
from .utils import jacobian_numba, predict_numba, pop_extra_coords
from ..forward.utils import distance_spherical
class EQLHarmonicSpherical(vdb.BaseGridder):
dims ... | true | true |
1c4618e45d73910b099a098744c5bee6d758142c | 18,581 | py | Python | dali/test/python/test_operator_slice.py | ancientmooner/DALI | 355e8db8130cee0d20e9ae3d698f195278544995 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2020-05-09T03:07:07.000Z | 2021-06-15T14:48:04.000Z | dali/test/python/test_operator_slice.py | ancientmooner/DALI | 355e8db8130cee0d20e9ae3d698f195278544995 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | dali/test/python/test_operator_slice.py | ancientmooner/DALI | 355e8db8130cee0d20e9ae3d698f195278544995 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-04-26T14:59:51.000Z | 2020-04-26T14:59:51.000Z | # Copyright (c) 2019, NVIDIA CORPORATION. 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 applic... | 44.135392 | 119 | 0.592379 |
from nvidia.dali.pipeline import Pipeline
import nvidia.dali.ops as ops
import nvidia.dali.types as types
import nvidia.dali as dali
from nvidia.dali.backend_impl import TensorListGPU
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose
import os
from functools import partial
f... | true | true |
1c4618feed0faaaedbc546d3b6511a52116feb26 | 318 | py | Python | Lib/site-packages/django_makemessages_xgettext/management/commands/makemessagesxgettext.py | MortazaviM/Hackim | 28bf9897d1793176711d1c91f5b7ac57bf4b8a36 | [
"bzip2-1.0.6"
] | 2 | 2016-11-16T19:16:51.000Z | 2018-02-23T02:52:35.000Z | django_makemessages_xgettext/management/commands/makemessagesxgettext.py | resulto/django-makemessages-xgettext | 6af1590ec4dc2ffd6670e026d098cb0baa415d54 | [
"BSD-3-Clause"
] | null | null | null | django_makemessages_xgettext/management/commands/makemessagesxgettext.py | resulto/django-makemessages-xgettext | 6af1590ec4dc2ffd6670e026d098cb0baa415d54 | [
"BSD-3-Clause"
] | null | null | null | import django
if django.get_version().startswith("1.7"):
from django_makemessages_xgettext import django17_makemessagesxgettext
Command = django17_makemessagesxgettext.Command
else:
from django_makemessages_xgettext import django18_makemessagesxgettext
Command = django18_makemessagesxgettext.Command
| 35.333333 | 74 | 0.839623 | import django
if django.get_version().startswith("1.7"):
from django_makemessages_xgettext import django17_makemessagesxgettext
Command = django17_makemessagesxgettext.Command
else:
from django_makemessages_xgettext import django18_makemessagesxgettext
Command = django18_makemessagesxgettext.Command
| true | true |
1c4619c76a66576b7e0d2dd8529056fbf1cb9d05 | 67,648 | py | Python | dulwich/tests/test_porcelain.py | stmcginnis/dulwich | c33607e8d76643c6ec44b3010b138d2039c9acec | [
"Apache-2.0"
] | 1 | 2020-08-08T21:55:08.000Z | 2020-08-08T21:55:08.000Z | dulwich/tests/test_porcelain.py | stmcginnis/dulwich | c33607e8d76643c6ec44b3010b138d2039c9acec | [
"Apache-2.0"
] | null | null | null | dulwich/tests/test_porcelain.py | stmcginnis/dulwich | c33607e8d76643c6ec44b3010b138d2039c9acec | [
"Apache-2.0"
] | null | null | null | # test_porcelain.py -- porcelain tests
# Copyright (C) 2013 Jelmer Vernooij <jelmer@jelmer.uk>
#
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
# General Public License as public by the Free Software Foundation; version 2.0
# or (at your option) any later version. You can redistribute it a... | 37.624027 | 97 | 0.58457 |
from io import BytesIO
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import errno
import os
import shutil
import tarfile
import tempfile
import time
from dulwich import porcelain
from dulwich.diff_tree import tree_changes
from dulwich.objects import (
B... | true | true |
1c461aa2e5f63fa27680aa6cf11215cb8e9c8883 | 1,802 | py | Python | rllib/examples/export/onnx_torch.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 22 | 2018-05-08T05:52:34.000Z | 2020-04-01T10:09:55.000Z | rllib/examples/export/onnx_torch.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 73 | 2021-09-25T07:11:39.000Z | 2022-03-26T07:10:59.000Z | rllib/examples/export/onnx_torch.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 10 | 2018-04-27T10:50:59.000Z | 2020-02-24T02:41:43.000Z | from distutils.version import LooseVersion
import numpy as np
import ray
import ray.rllib.agents.ppo as ppo
import onnxruntime
import os
import shutil
import torch
# Configure our PPO trainer
config = ppo.DEFAULT_CONFIG.copy()
config["num_gpus"] = 0
config["num_workers"] = 1
config["framework"] = "torch"
outdir = "e... | 26.115942 | 86 | 0.736404 | from distutils.version import LooseVersion
import numpy as np
import ray
import ray.rllib.agents.ppo as ppo
import onnxruntime
import os
import shutil
import torch
config = ppo.DEFAULT_CONFIG.copy()
config["num_gpus"] = 0
config["num_workers"] = 1
config["framework"] = "torch"
outdir = "export_torch"
if os.path.exi... | true | true |
1c461b183b4ab4d591ec0f8eb4bc1dd4b40c8651 | 152 | py | Python | webapp/urls.py | knschuckmann/Django_tableview | 1b874baf96fc72756e63f9c4178465c7064b9465 | [
"Apache-2.0"
] | null | null | null | webapp/urls.py | knschuckmann/Django_tableview | 1b874baf96fc72756e63f9c4178465c7064b9465 | [
"Apache-2.0"
] | null | null | null | webapp/urls.py | knschuckmann/Django_tableview | 1b874baf96fc72756e63f9c4178465c7064b9465 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from django.urls import path
from webapp import views
urlpatterns = [
path('', views.TableView.as_view(), name='webapp'),
] | 21.714286 | 55 | 0.664474 |
from django.urls import path
from webapp import views
urlpatterns = [
path('', views.TableView.as_view(), name='webapp'),
] | true | true |
1c461b501e3b828ff0c81891547cab2ecf40fbec | 4,713 | py | Python | messages.py | sushi-irc/nigiri | 9e1137a80f350ea05ae76df93061d3dc188e1ba7 | [
"BSD-2-Clause"
] | 1 | 2017-07-24T19:31:19.000Z | 2017-07-24T19:31:19.000Z | messages.py | sushi-irc/nigiri | 9e1137a80f350ea05ae76df93061d3dc188e1ba7 | [
"BSD-2-Clause"
] | null | null | null | messages.py | sushi-irc/nigiri | 9e1137a80f350ea05ae76df93061d3dc188e1ba7 | [
"BSD-2-Clause"
] | 1 | 2019-01-31T19:16:16.000Z | 2019-01-31T19:16:16.000Z | # coding: UTF-8
"""
Copyright (c) 2009 Marian Tietz
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions a... | 28.221557 | 75 | 0.737747 |
"""
Copyright (c) 2009 Marian Tietz
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the followin... | false | true |
1c461c15867001aca948defb8fbac5a5e9fb967f | 11,442 | py | Python | tests/Demo.py | adityasingh177/trusted-compute-framework | b91410f6da21ba4d7458dd02048a447bcd4fed5a | [
"Apache-2.0"
] | null | null | null | tests/Demo.py | adityasingh177/trusted-compute-framework | b91410f6da21ba4d7458dd02048a447bcd4fed5a | [
"Apache-2.0"
] | null | null | null | tests/Demo.py | adityasingh177/trusted-compute-framework | b91410f6da21ba4d7458dd02048a447bcd4fed5a | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 40.718861 | 107 | 0.569743 |
import os
import sys
import time
import argparse
import random
import json
import logging
from service_client.generic import GenericServiceClient
import crypto.crypto as crypto
import utility.signature as signature
import worker.worker_details as worker
from shared_kv.shared_kv_interface import KvStorage... | true | true |
1c461c7ae39191873d06db62c17134524c45c945 | 16,111 | py | Python | vstruct/defs/pcap.py | rnui2k/vivisect | b7b00f2d03defef28b4b8c912e3a8016e956c5f7 | [
"ECL-2.0",
"Apache-2.0"
] | 716 | 2015-01-01T14:41:11.000Z | 2022-03-28T06:51:50.000Z | vstruct/defs/pcap.py | rnui2k/vivisect | b7b00f2d03defef28b4b8c912e3a8016e956c5f7 | [
"ECL-2.0",
"Apache-2.0"
] | 266 | 2015-01-01T15:07:27.000Z | 2022-03-30T15:19:26.000Z | vstruct/defs/pcap.py | rnui2k/vivisect | b7b00f2d03defef28b4b8c912e3a8016e956c5f7 | [
"ECL-2.0",
"Apache-2.0"
] | 159 | 2015-01-01T16:19:44.000Z | 2022-03-21T21:55:34.000Z | import logging
import vstruct
import vstruct.defs.inet as vs_inet
from vstruct.primitives import *
logger = logging.getLogger(__name__)
PCAP_LINKTYPE_ETHER = 1
PCAP_LINKTYPE_RAW = 101
PCAP_LINKTYPE_LINUX_SLL = 113
PCAP_DLT_RAW = 12
PCAPNG_BOM = 0x1A2B3C4D
OPT_ENDOFOPT =... | 32.547475 | 119 | 0.597232 | import logging
import vstruct
import vstruct.defs.inet as vs_inet
from vstruct.primitives import *
logger = logging.getLogger(__name__)
PCAP_LINKTYPE_ETHER = 1
PCAP_LINKTYPE_RAW = 101
PCAP_LINKTYPE_LINUX_SLL = 113
PCAP_DLT_RAW = 12
PCAPNG_BOM = 0x1A2B3C4D
OPT_ENDOFOPT =... | true | true |
1c461db4bc60cf1e92582559dd48bd01ee94d6f7 | 456 | py | Python | src/util/__init__.py | seahrh/coding-interview | 517d19e7e88c02acec4aa6336bc20206ce3f1897 | [
"MIT"
] | null | null | null | src/util/__init__.py | seahrh/coding-interview | 517d19e7e88c02acec4aa6336bc20206ce3f1897 | [
"MIT"
] | null | null | null | src/util/__init__.py | seahrh/coding-interview | 517d19e7e88c02acec4aa6336bc20206ce3f1897 | [
"MIT"
] | null | null | null | from typing import Iterable
# skip mypy check because open issue https://github.com/python/typing/issues/760
def argmin(elements: Iterable) -> int:
"""Returns first index of smallest element."""
return min(enumerate(elements), key=lambda x: x[1])[0] # type: ignore
def argmax(elements: Iterable) ... | 32.571429 | 81 | 0.677632 | from typing import Iterable
def argmin(elements: Iterable) -> int:
return min(enumerate(elements), key=lambda x: x[1])[0]
def argmax(elements: Iterable) -> int:
return max(enumerate(elements), key=lambda x: x[1])[0]
| true | true |
1c461e2d8f683c54e0e3cf71b790ddfb6dc91f8a | 2,131 | py | Python | opencv_disparity/test.py | salihmarangoz/StereoDepthEstimation | a068df34329ee0642b5eb4277dedcd7012d78b4d | [
"MIT"
] | null | null | null | opencv_disparity/test.py | salihmarangoz/StereoDepthEstimation | a068df34329ee0642b5eb4277dedcd7012d78b4d | [
"MIT"
] | null | null | null | opencv_disparity/test.py | salihmarangoz/StereoDepthEstimation | a068df34329ee0642b5eb4277dedcd7012d78b4d | [
"MIT"
] | null | null | null | ##################################################################################
# SOURCE: https://github.com/aliyasineser/stereoDepth/blob/master/stereo_depth.py
##################################################################################
import numpy as np
import cv2 as cv
import cv2
from matplotlib import p... | 38.745455 | 136 | 0.63679 | true | true | |
1c461f5be0efef6234d9d0aa8c49ba9cdafb8ecd | 10,102 | py | Python | tests/unit/fs.py | ach3/fibratus | 655f0e6cee88caff4f75488fd90bf1bb00693847 | [
"Apache-2.0"
] | null | null | null | tests/unit/fs.py | ach3/fibratus | 655f0e6cee88caff4f75488fd90bf1bb00693847 | [
"Apache-2.0"
] | null | null | null | tests/unit/fs.py | ach3/fibratus | 655f0e6cee88caff4f75488fd90bf1bb00693847 | [
"Apache-2.0"
] | 1 | 2022-03-07T08:05:34.000Z | 2022-03-07T08:05:34.000Z | # Copyright 2015 by Nedim Sabic (RabbitStack)
# All Rights Reserved.
# http://rabbitstack.github.io
# 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... | 65.597403 | 123 | 0.544447 |
from unittest.mock import Mock
import pytest
from fibratus.common import DotD as dd, NA
from fibratus.fs import FsIO, FileOps
from fibratus.handle import HandleInfo, HandleType
from fibratus.kevent import KEvent
from fibratus.kevent_types import CREATE_FILE, DELETE_FILE, WRITE_FILE, RENAME_FILE, SET_F... | true | true |
1c461fa375b527ed770883ccd44488bbb7967dad | 1,644 | py | Python | temp_scripts/update_parameters.py | openmaker-eu/watchtower | af4d3e92b4cf0bf93c10e288a8b8ea97079da86d | [
"MIT"
] | 2 | 2017-05-16T10:57:29.000Z | 2017-12-14T11:33:18.000Z | temp_scripts/update_parameters.py | openmaker-eu/watchtower | af4d3e92b4cf0bf93c10e288a8b8ea97079da86d | [
"MIT"
] | 9 | 2018-11-29T07:44:15.000Z | 2021-12-13T19:54:18.000Z | temp_scripts/update_parameters.py | openmaker-eu/watchtower | af4d3e92b4cf0bf93c10e288a8b8ea97079da86d | [
"MIT"
] | 1 | 2019-02-28T19:00:47.000Z | 2019-02-28T19:00:47.000Z | from application.Connections import Connection
from pdb import set_trace
def updateAudienceParameters(topicID, location, signal_strength):
with Connection.Instance().get_cursor() as cur:
sql = (
"UPDATE audience_parameters "
"SET signal_strength = %s "
"WHERE ... | 34.25 | 113 | 0.58455 | from application.Connections import Connection
from pdb import set_trace
def updateAudienceParameters(topicID, location, signal_strength):
with Connection.Instance().get_cursor() as cur:
sql = (
"UPDATE audience_parameters "
"SET signal_strength = %s "
"WHERE ... | true | true |
1c462039acecb8d459a5e841e0c153542b907b5f | 3,583 | py | Python | sympy/concrete/products.py | gnulinooks/sympy | 46f63841f96cd025289b91ba9db3e261138d720a | [
"BSD-3-Clause"
] | 1 | 2016-05-09T10:08:18.000Z | 2016-05-09T10:08:18.000Z | sympy/concrete/products.py | gnulinooks/sympy | 46f63841f96cd025289b91ba9db3e261138d720a | [
"BSD-3-Clause"
] | null | null | null | sympy/concrete/products.py | gnulinooks/sympy | 46f63841f96cd025289b91ba9db3e261138d720a | [
"BSD-3-Clause"
] | null | null | null |
from sympy.core import Basic, S, C, Add, Mul, Symbol, sympify
from sympy.polys import quo, roots
from sympy.simplify import powsimp
class Product(Basic):
"""Represents unevaluated product.
"""
def __new__(cls, term, *symbols, **assumptions):
term = sympify(term)
if term.is_Number:
... | 25.055944 | 80 | 0.476137 |
from sympy.core import Basic, S, C, Add, Mul, Symbol, sympify
from sympy.polys import quo, roots
from sympy.simplify import powsimp
class Product(Basic):
def __new__(cls, term, *symbols, **assumptions):
term = sympify(term)
if term.is_Number:
if term is S.NaN:
return... | true | true |
1c4620bd5f4a647daadaabbb35603c6d6b7b073f | 7,172 | py | Python | fiber/middleware.py | bsimons/django-fiber | 0f4b03217a4aeba6b48908825507fbe8c5732c8d | [
"Apache-2.0"
] | null | null | null | fiber/middleware.py | bsimons/django-fiber | 0f4b03217a4aeba6b48908825507fbe8c5732c8d | [
"Apache-2.0"
] | null | null | null | fiber/middleware.py | bsimons/django-fiber | 0f4b03217a4aeba6b48908825507fbe8c5732c8d | [
"Apache-2.0"
] | null | null | null | import random
import re
import json
from urllib import unquote
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.template import loader, RequestContext
from django.utils.encoding import smart_text
from django.utils.html import escape
from fiber.app_settings import L... | 43.204819 | 198 | 0.641104 | import random
import re
import json
from urllib import unquote
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.template import loader, RequestContext
from django.utils.encoding import smart_text
from django.utils.html import escape
from fiber.app_settings import L... | true | true |
1c46219a94ef2b0745f859e73be317175fb547fb | 391 | py | Python | rsvp/urls.py | DXDSpirits/appsbackend | 2c69487c4e4d6dc78091ba8030889a5ddc990836 | [
"MIT"
] | null | null | null | rsvp/urls.py | DXDSpirits/appsbackend | 2c69487c4e4d6dc78091ba8030889a5ddc990836 | [
"MIT"
] | null | null | null | rsvp/urls.py | DXDSpirits/appsbackend | 2c69487c4e4d6dc78091ba8030889a5ddc990836 | [
"MIT"
] | null | null | null | from django.conf.urls import url, patterns, include
from rest_framework.routers import DefaultRouter
from rsvp import views
router = DefaultRouter()
router.register(r'rsvp', views.RsvpViewSet)
router.register(r'guest', views.GuestViewSet)
urlpatterns = patterns('',
url(r'^', include(router.urls)),
url(r'^api-... | 30.076923 | 83 | 0.754476 | from django.conf.urls import url, patterns, include
from rest_framework.routers import DefaultRouter
from rsvp import views
router = DefaultRouter()
router.register(r'rsvp', views.RsvpViewSet)
router.register(r'guest', views.GuestViewSet)
urlpatterns = patterns('',
url(r'^', include(router.urls)),
url(r'^api-... | true | true |
1c4624dd307575e0198507f2f32738456ad7f101 | 1,086 | py | Python | util.py | mhaberler/jumpvis | 93b3b723d27aab7f3d4319cc91d06432022ddc6d | [
"MIT"
] | null | null | null | util.py | mhaberler/jumpvis | 93b3b723d27aab7f3d4319cc91d06432022ddc6d | [
"MIT"
] | null | null | null | util.py | mhaberler/jumpvis | 93b3b723d27aab7f3d4319cc91d06432022ddc6d | [
"MIT"
] | null | null | null |
def get_bounds(points):
"""
return bounding box of a list of gpxpy points
"""
min_lat = None
max_lat = None
min_lon = None
max_lon = None
min_ele = None
max_ele = None
for point in points:
if min_lat is None or point.latitude < min_lat:
min_lat = point.latit... | 32.909091 | 67 | 0.608656 |
def get_bounds(points):
min_lat = None
max_lat = None
min_lon = None
max_lon = None
min_ele = None
max_ele = None
for point in points:
if min_lat is None or point.latitude < min_lat:
min_lat = point.latitude
if max_lat is None or point.latitude > max_lat:
... | true | true |
1c4624f33204aa75a7cdc3d84fb7b0e45eb71211 | 8,645 | py | Python | vendor-local/lib/python/taggit/managers.py | lmorchard/badg.us | aa75b9cb6858e99de16aa840add0eef9065fdb4c | [
"BSD-3-Clause"
] | 4 | 2015-09-01T01:19:45.000Z | 2018-05-16T16:03:10.000Z | vendor-local/lib/python/taggit/managers.py | lmorchard/badg.us | aa75b9cb6858e99de16aa840add0eef9065fdb4c | [
"BSD-3-Clause"
] | 7 | 2022-01-11T19:42:12.000Z | 2022-01-11T19:42:55.000Z | vendor-local/lib/python/taggit/managers.py | lmorchard/badg.us | aa75b9cb6858e99de16aa840add0eef9065fdb4c | [
"BSD-3-Clause"
] | 3 | 2015-05-21T15:36:01.000Z | 2020-11-20T23:58:12.000Z | from django.contrib.contenttypes.generic import GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.fields.related import ManyToManyRel, RelatedField, add_lazy_relation
from django.db.models.related import RelatedObject
from django.utils.text imp... | 34.035433 | 90 | 0.616888 | from django.contrib.contenttypes.generic import GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.fields.related import ManyToManyRel, RelatedField, add_lazy_relation
from django.db.models.related import RelatedObject
from django.utils.text imp... | true | true |
1c46258e69edc1d51b3b465582f6145ad636ebc5 | 813 | py | Python | Controller/countryStatisticsHashedUserIdsController.py | lionick/map-ip-to-country | ccc44b511b7cf1451849038bae66e682140a68a9 | [
"Apache-2.0"
] | null | null | null | Controller/countryStatisticsHashedUserIdsController.py | lionick/map-ip-to-country | ccc44b511b7cf1451849038bae66e682140a68a9 | [
"Apache-2.0"
] | null | null | null | Controller/countryStatisticsHashedUserIdsController.py | lionick/map-ip-to-country | ccc44b511b7cf1451849038bae66e682140a68a9 | [
"Apache-2.0"
] | 1 | 2021-03-16T11:07:22.000Z | 2021-03-16T11:07:22.000Z | from datetime import date, timedelta
from Model.ipStatistics import ipStatistics
from Model.countryStatisticsHashedUserId import countryStatisticsHashedUserId
from datetime import datetime, timedelta
class countryStatisticsHashedUserIdsController:
@classmethod
def getDataNotMapped(self):
dateFrom = countryStati... | 33.875 | 77 | 0.723247 | from datetime import date, timedelta
from Model.ipStatistics import ipStatistics
from Model.countryStatisticsHashedUserId import countryStatisticsHashedUserId
from datetime import datetime, timedelta
class countryStatisticsHashedUserIdsController:
@classmethod
def getDataNotMapped(self):
dateFrom = countryStati... | true | true |
1c46261cd54386528b25cc006d779402084d8229 | 484 | py | Python | PyPark/version.py | liuzhuogood/PyPark | e605502344a3bfcc7696ba56f193fd50d773f1ea | [
"Apache-2.0"
] | 1 | 2021-11-16T10:33:01.000Z | 2021-11-16T10:33:01.000Z | PyPark/version.py | liuzhuogood/PyPark | e605502344a3bfcc7696ba56f193fd50d773f1ea | [
"Apache-2.0"
] | null | null | null | PyPark/version.py | liuzhuogood/PyPark | e605502344a3bfcc7696ba56f193fd50d773f1ea | [
"Apache-2.0"
] | null | null | null | import logging
from PyPark.util.zk_util import path_join
def print_infos(pk):
for u in pk.rest.services.keys():
pk.log.info(f"Rest Service : /{path_join(pk.rest_base_url, u)}")
if len(pk.rest.services.keys()) > 0:
logging.info(f"Started By [{pk.group}] http://{pk.ip}:{pk.port}")
if pk.nat... | 32.266667 | 74 | 0.646694 | import logging
from PyPark.util.zk_util import path_join
def print_infos(pk):
for u in pk.rest.services.keys():
pk.log.info(f"Rest Service : /{path_join(pk.rest_base_url, u)}")
if len(pk.rest.services.keys()) > 0:
logging.info(f"Started By [{pk.group}] http://{pk.ip}:{pk.port}")
if pk.nat... | true | true |
1c4626a4a0981b699bd3f0e091123348bc6f9ecc | 1,097 | py | Python | python/ConvertDocx2HtmlUsingWord.py | netchira/netchira.github.io | bed7b1425fe0ec206887be9cf48a571afbded9e8 | [
"CC0-1.0"
] | 6 | 2019-09-25T06:43:01.000Z | 2022-03-11T02:54:47.000Z | python/ConvertDocx2HtmlUsingWord.py | netchira/netchira.github.io | bed7b1425fe0ec206887be9cf48a571afbded9e8 | [
"CC0-1.0"
] | 6 | 2019-01-06T07:35:10.000Z | 2022-02-26T03:46:28.000Z | python/ConvertDocx2HtmlUsingWord.py | netchira/netchira.github.io | bed7b1425fe0ec206887be9cf48a571afbded9e8 | [
"CC0-1.0"
] | 7 | 2021-05-14T07:04:36.000Z | 2022-03-20T18:23:28.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon May 26 21:28:35 2019
Spyderエディタ
For Python ver 2.7
@author: netchira
"""
def ConvertDocx2HtmlUsingWord(DocxFilePath):
import win32com.client
import os
# ファイル拡張子の確認
if os.path.exists(DocxFilePath) and (DocxFilePath[-5:] == ".docx"):
# ファイルパスから拡張子(ピリオド含む... | 26.119048 | 71 | 0.678213 |
def ConvertDocx2HtmlUsingWord(DocxFilePath):
import win32com.client
import os
if os.path.exists(DocxFilePath) and (DocxFilePath[-5:] == ".docx"):
str_FilePathNoExt = DocxFilePath[0:-5]
str_HtmlFilePath = str_FilePathNoExt + ".htm"
HtmlFilePath = os.p... | true | true |
1c4627682d3ef50f786fa60721404010b28e5f2d | 2,151 | py | Python | misp/utils/wsi_utils.py | zhoudaxia233/misp | c0d36e3f1a1eeac417d6bfff015ea5430f1d0de5 | [
"MIT"
] | 2 | 2019-12-21T10:46:57.000Z | 2019-12-22T14:01:23.000Z | misp/utils/wsi_utils.py | zhoudaxia233/misp | c0d36e3f1a1eeac417d6bfff015ea5430f1d0de5 | [
"MIT"
] | null | null | null | misp/utils/wsi_utils.py | zhoudaxia233/misp | c0d36e3f1a1eeac417d6bfff015ea5430f1d0de5 | [
"MIT"
] | null | null | null | import os
import openslide
from openslide.deepzoom import DeepZoomGenerator
from tqdm import tqdm
__all__ = ['WSI', 'validate_mpp', 'stitch_tiles']
class WSI():
def __init__(self, path: str, tile_size: int = 224):
self.path = path
self.tile_size = tile_size
self.slide = openslide.OpenSlid... | 38.410714 | 114 | 0.666202 | import os
import openslide
from openslide.deepzoom import DeepZoomGenerator
from tqdm import tqdm
__all__ = ['WSI', 'validate_mpp', 'stitch_tiles']
class WSI():
def __init__(self, path: str, tile_size: int = 224):
self.path = path
self.tile_size = tile_size
self.slide = openslide.OpenSlid... | true | true |
1c4627bc2af1de74f5fa845dc646606e7fc21076 | 110,473 | py | Python | ds_discovery/sample/map_companies_fortune1000.py | project-hadron/discovery-transition-ds | 08229ca3b7617b42ce2dd8e47ff93876c0843810 | [
"BSD-3-Clause"
] | 2 | 2020-09-21T17:24:16.000Z | 2021-05-28T18:02:54.000Z | ds_discovery/sample/map_companies_fortune1000.py | project-hadron/discovery-transition-ds | 08229ca3b7617b42ce2dd8e47ff93876c0843810 | [
"BSD-3-Clause"
] | null | null | null | ds_discovery/sample/map_companies_fortune1000.py | project-hadron/discovery-transition-ds | 08229ca3b7617b42ce2dd8e47ff93876c0843810 | [
"BSD-3-Clause"
] | 1 | 2021-07-23T13:52:04.000Z | 2021-07-23T13:52:04.000Z | data={'title': ['Walmart', 'Exxon Mobil', 'Berkshire Hathaway', 'Apple', 'UnitedHealth Group', 'McKesson', 'CVS Health', 'Amazon.com', 'AT&T', 'General Motors', 'Ford Motor', 'AmerisourceBergen', 'Chevron', 'Cardinal Health', 'Costco', 'Verizon', 'Kroger', 'General Electric', 'Walgreens Boots Alliance', 'JPMorgan Chase... | 55,236.5 | 110,472 | 0.712165 | data={'title': ['Walmart', 'Exxon Mobil', 'Berkshire Hathaway', 'Apple', 'UnitedHealth Group', 'McKesson', 'CVS Health', 'Amazon.com', 'AT&T', 'General Motors', 'Ford Motor', 'AmerisourceBergen', 'Chevron', 'Cardinal Health', 'Costco', 'Verizon', 'Kroger', 'General Electric', 'Walgreens Boots Alliance', 'JPMorgan Chase... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.