hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dec9be5d7623bfb01463ca78be5f847f3b7dae8e | 1,494 | py | Python | tests/transformations/state_fusion_node_merge_test.py | targetsm/dace | 297b12804a334df8cc6fad5250d5fb0cce20dc6e | [
"BSD-3-Clause"
] | null | null | null | tests/transformations/state_fusion_node_merge_test.py | targetsm/dace | 297b12804a334df8cc6fad5250d5fb0cce20dc6e | [
"BSD-3-Clause"
] | null | null | null | tests/transformations/state_fusion_node_merge_test.py | targetsm/dace | 297b12804a334df8cc6fad5250d5fb0cce20dc6e | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019-2020 ETH Zurich and the DaCe authors. All rights reserved.
import dace
import numpy as np
N = dace.symbol('N')
@dace.program
def test1(A: dace.float64[N], B:dace.float64[N]):
for i in dace.map[0:N]:
with dace.tasklet:
input << A[i]
out >> A[i]
out = inp... | 23.34375 | 75 | 0.53012 |
2d3eca997ff33f0fc9408971a510324c3b811a23 | 594 | py | Python | catalog/bindings/gmd/linear_cs.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/gmd/linear_cs.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/gmd/linear_cs.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from bindings.gmd.linear_cstype import LinearCstype
__NAMESPACE__ = "http://www.opengis.net/gml"
@dataclass
class LinearCs(LinearCstype):
"""gml:LinearCS is a one-dimensional coordinate system that consists of the
points that lie on the single axis described.
The associ... | 29.7 | 79 | 0.727273 |
c2de6617e443011642cea3d79b7e54d2cde87b20 | 693 | py | Python | init_db.py | Samar-Bons/Flask_Blog | f765cd7c124fc9249596c7606ed417a325aa5f53 | [
"MIT"
] | null | null | null | init_db.py | Samar-Bons/Flask_Blog | f765cd7c124fc9249596c7606ed417a325aa5f53 | [
"MIT"
] | null | null | null | init_db.py | Samar-Bons/Flask_Blog | f765cd7c124fc9249596c7606ed417a325aa5f53 | [
"MIT"
] | null | null | null | #Module to initialize a db named "database.db" which will store
#post IDs, time_created, Title, and Post content
import sqlite3
connection = sqlite3.connect('database.db')
# Executing schema.sql script to initialize our db
with open('schema.sql') as f:
connection.executescript(f.read())
# Prepopulating the dat... | 27.72 | 64 | 0.681097 |
6cbc39d8b2c0f6c2e561a77d724782f6f5f6e212 | 4,278 | py | Python | relationships/templatetags/relationship_tags.py | SalahAdDin/django-relationships | a1f98e5b3d0f8e9b12b616d3c3d4153f7f7b06bc | [
"MIT"
] | null | null | null | relationships/templatetags/relationship_tags.py | SalahAdDin/django-relationships | a1f98e5b3d0f8e9b12b616d3c3d4153f7f7b06bc | [
"MIT"
] | null | null | null | relationships/templatetags/relationship_tags.py | SalahAdDin/django-relationships | a1f98e5b3d0f8e9b12b616d3c3d4153f7f7b06bc | [
"MIT"
] | null | null | null | from django import template
from django.urls import reverse
try:
from django.db.models.loading import get_model
except ImportError:
from django.apps import apps
get_model = apps.get_model
from django.template import TemplateSyntaxError
from django.utils.functional import wraps
from django.utils.translati... | 28.711409 | 79 | 0.687705 |
a0169a974f81264426a0688fb07602fbf79e8796 | 1,564 | py | Python | ipylivebash/tests/test_runner.py | benlau/ipylivebash | 1d935efecf69ebc55983722dd9b811c5f80b1f88 | [
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | 6 | 2022-01-02T19:33:05.000Z | 2022-03-02T02:14:20.000Z | ipylivebash/tests/test_runner.py | benlau/ipylivebash | 1d935efecf69ebc55983722dd9b811c5f80b1f88 | [
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | 1 | 2022-01-17T18:08:25.000Z | 2022-01-29T22:35:10.000Z | ipylivebash/tests/test_runner.py | benlau/ipylivebash | 1d935efecf69ebc55983722dd9b811c5f80b1f88 | [
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | from unittest.mock import MagicMock
import time
from ..runner import Runner, run_script, execute_script_in_thread
ECHO_SCRIPT = "echo 123"
def test_runner_parse_args():
runner = Runner("--help".split())
assert runner.args.print_help is True
assert runner.args.keep_cell_output is False
runner = Runne... | 25.225806 | 66 | 0.688619 |
16a4c9190e5df021753712d2f42b13f6c31b0fed | 16,678 | py | Python | facet/configuration.py | edponce/FACET | 0dca2d728813a4865e72b2e8fd6b114a0c63d5b0 | [
"MIT"
] | 2 | 2020-10-16T19:27:21.000Z | 2021-11-04T15:06:54.000Z | facet/configuration.py | edponce/FACET | 0dca2d728813a4865e72b2e8fd6b114a0c63d5b0 | [
"MIT"
] | 24 | 2020-07-13T01:49:36.000Z | 2020-10-30T21:54:00.000Z | facet/configuration.py | edponce/FACET | 0dca2d728813a4865e72b2e8fd6b114a0c63d5b0 | [
"MIT"
] | null | null | null | import os
import re
import copy
import yaml
import json
import pyparsing
import configparser
from typing import (
Any,
Dict,
Union,
Iterable,
)
__all__ = ['Configuration']
# Boolean and None states are case-insensitive
BOOLEAN_STATES = {
True: ('true', 'yes', 'on', 'accept', 'enable'),
False... | 32.447471 | 79 | 0.597254 |
66981e06e9c908c9cb8573a8e7c5d4a9b8632902 | 6,293 | py | Python | docs/conf.py | timgates42/pyttsx | 1a84ee33971951b1ea18f2708061a5d19ef94018 | [
"FSFAP"
] | 160 | 2016-10-04T22:45:36.000Z | 2022-02-10T06:41:56.000Z | docs/conf.py | simz089s/pyttsx | 4ad1e84fdefee4eed290fdc966573cb57d0b0079 | [
"FSFAP"
] | 27 | 2016-10-04T02:45:18.000Z | 2022-03-09T15:15:54.000Z | docs/conf.py | simz089s/pyttsx | 4ad1e84fdefee4eed290fdc966573cb57d0b0079 | [
"FSFAP"
] | 58 | 2016-10-06T16:53:43.000Z | 2021-10-21T22:17:35.000Z | # -*- coding: utf-8 -*-
#
# pyttsx documentation build configuration file, created by
# sphinx-quickstart on Sun Nov 1 09:40:19 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All ... | 32.271795 | 80 | 0.722708 |
dd09270e73d492b8977b90e570294b345e62791b | 2,500 | py | Python | test/selenium/src/tests/test_unified_mapper.py | j0gurt/ggrc-core | 84662dc85aa8864c907eabe70b8efccf92298a1f | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-01-04T10:55:14.000Z | 2019-01-04T10:55:14.000Z | test/selenium/src/tests/test_unified_mapper.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/selenium/src/tests/test_unified_mapper.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2018 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Unified mapper tests."""
# pylint: disable=no-self-use
# pylint: disable=invalid-name
import pytest
from lib import base, users
from lib.entities import entities_factory
from lib.entities.entity import R... | 42.372881 | 79 | 0.7744 |
cb8b8168abd406ac3172b2ed5c46a4d6031fcaab | 2,559 | py | Python | project/drupal.py | thomasdiluccio/template-builder | effb471d7644c7d589a2ed8f6c70be887bdae5d5 | [
"MIT"
] | null | null | null | project/drupal.py | thomasdiluccio/template-builder | effb471d7644c7d589a2ed8f6c70be887bdae5d5 | [
"MIT"
] | null | null | null | project/drupal.py | thomasdiluccio/template-builder | effb471d7644c7d589a2ed8f6c70be887bdae5d5 | [
"MIT"
] | null | null | null | from . import BaseProject
from .remote import RemoteProject
import json
from collections import OrderedDict
class Drupal7_vanilla(BaseProject):
version = '7.67'
@property
def update(self):
return super(Drupal7_vanilla, self).update + [
"wget https://ftp.drupal.org/files/projects/drupal... | 40.619048 | 156 | 0.669793 |
92235ee751f5bdc387e7ba6c286e1e30c5739a8b | 4,964 | py | Python | adamw.py | imics-lab/tts-gan | 872213938a68ca63570f9f1df0ccc8e179d73ab2 | [
"Apache-2.0"
] | 14 | 2022-01-25T09:57:59.000Z | 2022-03-28T04:27:12.000Z | adamw.py | imics-lab/tts-gan | 872213938a68ca63570f9f1df0ccc8e179d73ab2 | [
"Apache-2.0"
] | 1 | 2022-03-11T07:11:32.000Z | 2022-03-11T15:09:21.000Z | adamw.py | imics-lab/tts-gan | 872213938a68ca63570f9f1df0ccc8e179d73ab2 | [
"Apache-2.0"
] | 3 | 2022-02-11T15:22:41.000Z | 2022-03-27T11:10:58.000Z | """ AdamW Optimizer
Impl copied from PyTorch master
"""
import math
import torch
from torch.optim.optimizer import Optimizer
class AdamW(Optimizer):
r"""Implements AdamW algorithm.
The original Adam algorithm was proposed in `Adam: A Method for Stochastic Optimization`_.
The AdamW variant was proposed in... | 42.42735 | 116 | 0.577357 |
7e5f7ea4df406d8c403e706764e541c8a3f2cc3f | 4,129 | py | Python | qiling/qiling/cc/__init__.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | 2 | 2021-05-05T12:03:01.000Z | 2021-06-04T14:27:15.000Z | qiling/qiling/cc/__init__.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | null | null | null | qiling/qiling/cc/__init__.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | 2 | 2021-05-05T12:03:09.000Z | 2021-06-04T14:27:21.000Z | #!/usr/bin/env python3
#
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
from typing import Callable, Tuple
from qiling import Qiling
class QlCC:
"""Calling convention base class.
"""
def __init__(self, ql: Qiling) -> None:
"""Initialize a calling convention instance.
Args:
q... | 27.344371 | 108 | 0.717365 |
0592bb492266682f5fb2d4e5e66ce2ac965b453e | 33,976 | py | Python | couchjs/scons/scons-local-2.0.1/SCons/Builder.py | Gussy/bigcouch | 9e67d3f754186ce8368503509ae041a2847f2b7c | [
"Apache-2.0"
] | 73 | 2015-03-19T04:04:52.000Z | 2021-08-16T10:45:11.000Z | couchjs/scons/scons-local-2.0.1/SCons/Builder.py | Gussy/bigcouch | 9e67d3f754186ce8368503509ae041a2847f2b7c | [
"Apache-2.0"
] | 5 | 2016-04-26T13:19:25.000Z | 2017-03-11T14:11:22.000Z | couchjs/scons/scons-local-2.0.1/SCons/Builder.py | Gussy/bigcouch | 9e67d3f754186ce8368503509ae041a2847f2b7c | [
"Apache-2.0"
] | 13 | 2015-03-27T05:21:42.000Z | 2017-05-22T11:45:30.000Z | """SCons.Builder
Builder object subsystem.
A Builder object is a callable that encapsulates information about how
to execute actions to create a target Node (file) from source Nodes
(files), and how to create those dependencies for tracking.
The main entry point here is the Builder() factory method. This provides
a... | 38.697039 | 186 | 0.606222 |
763f7db739ce9fd6b00a655edf9a4fefe2c7e095 | 6,793 | py | Python | panel/widgets/base.py | govinda18/panel | d2b70d9a0a4433d427c627e70328d0bc8621d78b | [
"BSD-3-Clause"
] | 2 | 2018-08-23T16:50:40.000Z | 2018-08-23T20:01:45.000Z | panel/widgets/base.py | pyviz/pyviz_panels | 120019e4318ac51bc2b9d0a1b2eb2239c8a0c9ad | [
"BSD-3-Clause"
] | null | null | null | panel/widgets/base.py | pyviz/pyviz_panels | 120019e4318ac51bc2b9d0a1b2eb2239c8a0c9ad | [
"BSD-3-Clause"
] | null | null | null | """
Defines the Widget base class which provides bi-directional
communication between the rendered dashboard and the Widget
parameters.
"""
from __future__ import annotations
import math
from typing import (
TYPE_CHECKING, Any, Callable, List, Mapping, Optional, Tuple,
)
import param # type: ignore
from ..layo... | 32.194313 | 86 | 0.620639 |
4acdf127cec504c1e290947f0b6f88de0c63f82c | 9,788 | py | Python | tests/testflows/rbac/tests/syntax/revoke_role.py | taleh007/ClickHouse | c94ee3151d698a77c8d32f4b59b2b2678f0a9246 | [
"Apache-2.0"
] | null | null | null | tests/testflows/rbac/tests/syntax/revoke_role.py | taleh007/ClickHouse | c94ee3151d698a77c8d32f4b59b2b2678f0a9246 | [
"Apache-2.0"
] | null | null | null | tests/testflows/rbac/tests/syntax/revoke_role.py | taleh007/ClickHouse | c94ee3151d698a77c8d32f4b59b2b2678f0a9246 | [
"Apache-2.0"
] | 1 | 2021-04-22T15:27:46.000Z | 2021-04-22T15:27:46.000Z | from contextlib import contextmanager
from testflows.core import *
import rbac.helper.errors as errors
from rbac.requirements import *
@TestFeature
@Name("revoke role")
@Args(format_description=False)
def feature(self, node="clickhouse1"):
"""Check revoke query syntax.
```sql
REVOKE [ON CLUSTER cluster_... | 49.434343 | 109 | 0.627401 |
ba921d0b758fb1b369523509665d96049df0fa86 | 1,640 | py | Python | test/run/test_ostree.py | jmikovic/osbuild | 1476b88dcf1efa0221101b7b412bbe7934c6d2c6 | [
"Apache-2.0"
] | null | null | null | test/run/test_ostree.py | jmikovic/osbuild | 1476b88dcf1efa0221101b7b412bbe7934c6d2c6 | [
"Apache-2.0"
] | null | null | null | test/run/test_ostree.py | jmikovic/osbuild | 1476b88dcf1efa0221101b7b412bbe7934c6d2c6 | [
"Apache-2.0"
] | null | null | null | #
# Runtime / Integration Tests for ostree pipelines
#
import os
import tempfile
import unittest
from .. import test
@unittest.skipUnless(test.TestBase.have_test_data(), "no test-data access")
@unittest.skipUnless(test.TestBase.can_bind_mount(), "root-only")
class TestOSTree(test.TestBase):
def setUp(self):
... | 38.139535 | 89 | 0.545122 |
53659adb0c4013151a1dd85bc73afcf46db07b10 | 5,178 | py | Python | swagger_client/models/dimension.py | BruceNL/pdf-stamp---1.0 | d89a5f3bfddb77661588311188fe4ff310b781ee | [
"Apache-2.0"
] | null | null | null | swagger_client/models/dimension.py | BruceNL/pdf-stamp---1.0 | d89a5f3bfddb77661588311188fe4ff310b781ee | [
"Apache-2.0"
] | null | null | null | swagger_client/models/dimension.py | BruceNL/pdf-stamp---1.0 | d89a5f3bfddb77661588311188fe4ff310b781ee | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
PDF stamper
The PDF Stamper API enables the possibility to add both static and dynamic stamps on existing PDFs. The stamps can consist of one or more barcode, hyperlink, image, line or text elements. The flow is generally as follows: 1. Make a configuration containing the stamp informa... | 28.141304 | 636 | 0.566628 |
3ea11de396cd2e58caab31ecb3c3b0e263414dc6 | 5,034 | py | Python | apps/src/tax_credit.py | xgerrmann/geld-en-zo | d041c9812164b8c693d4ee86c1f897db05973df0 | [
"MIT"
] | null | null | null | apps/src/tax_credit.py | xgerrmann/geld-en-zo | d041c9812164b8c693d4ee86c1f897db05973df0 | [
"MIT"
] | null | null | null | apps/src/tax_credit.py | xgerrmann/geld-en-zo | d041c9812164b8c693d4ee86c1f897db05973df0 | [
"MIT"
] | null | null | null | import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objects as go
from dash.dependencies import Input, Output
from pfinsim.taxes import Taxes
import pfinsim
from common import app, default_salary
input_salary = default_salary
def plot_tax_credits(taxes, selected_year):
fig =... | 31.4625 | 118 | 0.623758 |
7716a37ee4386ea5a419ddc40b21d32a7de36ea7 | 18,105 | py | Python | tests/unit/lms/services/canvas_api/client_test.py | hypothesis/lms | 722dac444dc1e73298eea5193f871f3ddefe46fd | [
"BSD-2-Clause"
] | 38 | 2017-12-30T23:49:53.000Z | 2022-02-15T21:07:49.000Z | tests/unit/lms/services/canvas_api/client_test.py | hypothesis/lms | 722dac444dc1e73298eea5193f871f3ddefe46fd | [
"BSD-2-Clause"
] | 1,733 | 2017-11-09T18:46:05.000Z | 2022-03-31T11:05:50.000Z | tests/unit/lms/services/canvas_api/client_test.py | hypothesis/lms | 722dac444dc1e73298eea5193f871f3ddefe46fd | [
"BSD-2-Clause"
] | 10 | 2018-07-11T17:12:46.000Z | 2022-01-07T20:00:23.000Z | from unittest.mock import create_autospec, sentinel
import pytest
from h_matchers import Any
from pyramid.registry import Registry
from lms.events import FilesDiscoveredEvent
from lms.services import CanvasAPIError, CanvasAPIServerError, OAuth2TokenError
from lms.services.canvas_api.client import CanvasAPIClient
from... | 33.715084 | 92 | 0.582381 |
aeb113e20f94b2fe958b6d8514394f09972b0412 | 3,230 | py | Python | flower_dictionary.py | larry-x/flower-dictionary | def60dee0de5b4cfdc7c199f864563dcec88071c | [
"MIT"
] | null | null | null | flower_dictionary.py | larry-x/flower-dictionary | def60dee0de5b4cfdc7c199f864563dcec88071c | [
"MIT"
] | null | null | null | flower_dictionary.py | larry-x/flower-dictionary | def60dee0de5b4cfdc7c199f864563dcec88071c | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
# Flower_Dictionary: originally a program that allows you to catalog new flower names on an alien planet and save them to a txt file.
# There are just two fields: the first field is limited to 20 characters and the second field is limited to 80 characters.
# It can be used to keep reminders or s... | 35.108696 | 133 | 0.608978 |
dfa21df37fd35efc4af2eb4a946c07b5e931850d | 10,119 | py | Python | website/apps/monster/migrations/0002_auto__add_monsterinvite.py | bopopescu/drawquest-web | 8d8f9149b6efeb65202809a5f8916386f58a1b3b | [
"BSD-3-Clause"
] | 61 | 2015-11-10T17:13:46.000Z | 2021-08-06T17:58:30.000Z | website/apps/monster/migrations/0002_auto__add_monsterinvite.py | bopopescu/drawquest-web | 8d8f9149b6efeb65202809a5f8916386f58a1b3b | [
"BSD-3-Clause"
] | 13 | 2015-11-11T07:49:41.000Z | 2021-06-09T03:45:31.000Z | website/apps/monster/migrations/0002_auto__add_monsterinvite.py | bopopescu/drawquest-web | 8d8f9149b6efeb65202809a5f8916386f58a1b3b | [
"BSD-3-Clause"
] | 18 | 2015-11-11T04:50:04.000Z | 2021-08-20T00:57:11.000Z | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'MonsterInvite'
db.create_table('monster_monsterinvite', (
('id', self.gf('djan... | 77.244275 | 195 | 0.567349 |
53d402920ea27e179e57794f99b0be93555a7369 | 733 | py | Python | var/spack/repos/builtin/packages/fastjson/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/fastjson/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/fastjson/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class Fastjson(MavenPackage):
"""Fastjson is a Java library that can be used to convert ... | 36.65 | 96 | 0.735334 |
bd97323b99c2df3d394de6a3931a32a0fe43d57b | 32,500 | py | Python | example/sockeye/source/sockeye/encoder.py | rah9eu/p3 | 530628be7b7a8dd3e6199c3bebebdbf104005e5f | [
"Apache-2.0"
] | 22 | 2019-02-20T12:42:20.000Z | 2021-12-25T06:09:46.000Z | example/sockeye/source/sockeye/encoder.py | rah9eu/p3 | 530628be7b7a8dd3e6199c3bebebdbf104005e5f | [
"Apache-2.0"
] | 4 | 2019-04-01T07:36:04.000Z | 2022-03-24T03:11:26.000Z | example/sockeye/source/sockeye/encoder.py | rah9eu/p3 | 530628be7b7a8dd3e6199c3bebebdbf104005e5f | [
"Apache-2.0"
] | 7 | 2019-03-20T16:04:37.000Z | 2021-04-28T18:40:11.000Z | # Copyright 2017 Amazon.com, Inc. or its affiliates. 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. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file acc... | 42.539267 | 119 | 0.604185 |
319e38e1776b41e5c512ef361a49a7d8bed04377 | 997 | py | Python | boot-hid.py | dhylands/upy-examples | 90cca32f0c6c65c33967da9ac1a998e731c60d91 | [
"MIT"
] | 78 | 2015-01-15T23:24:21.000Z | 2022-02-25T09:24:58.000Z | boot-hid.py | dhylands/upy-examples | 90cca32f0c6c65c33967da9ac1a998e731c60d91 | [
"MIT"
] | 1 | 2015-02-04T00:51:52.000Z | 2015-02-04T00:51:52.000Z | boot-hid.py | dhylands/upy-examples | 90cca32f0c6c65c33967da9ac1a998e731c60d91 | [
"MIT"
] | 26 | 2015-02-03T21:26:33.000Z | 2022-02-21T02:57:46.000Z | # boot.py -- run on boot-up
#
# This is some common initialization that I like to keep around.
import pyb
import micropython
import sys
#pyb.main('main.py') # main script to run after this one
#pyb.usb_mode('CDC') # act as a serial only
#pyb.usb_mode('CDC+MSC') # act as a serial and a storage device
pyb.usb_mode('CDC+... | 26.945946 | 67 | 0.641926 |
834d4c93301bbd137e67de86cba380ce2969050a | 2,796 | py | Python | data/cirq_new/cirq_program/startCirq_pragma773.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/cirq_new/cirq_program/startCirq_pragma773.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/cirq_new/cirq_program/startCirq_pragma773.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=19
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
class Opty(cirq.PointOptimizer):
def optimization_at(
... | 32.894118 | 92 | 0.643777 |
fe1d9841a03e601b108132654f1df7937f543a90 | 533 | py | Python | scripts/rpc/pmem.py | ykirichok/spdk | db7f82baf819740025da0ba271745e89ba682f47 | [
"BSD-3-Clause"
] | null | null | null | scripts/rpc/pmem.py | ykirichok/spdk | db7f82baf819740025da0ba271745e89ba682f47 | [
"BSD-3-Clause"
] | null | null | null | scripts/rpc/pmem.py | ykirichok/spdk | db7f82baf819740025da0ba271745e89ba682f47 | [
"BSD-3-Clause"
] | 2 | 2019-01-30T16:18:59.000Z | 2020-05-27T15:41:37.000Z | def create_pmem_pool(args):
num_blocks = (args.total_size * 1024 * 1024) / args.block_size
params = {'pmem_file': args.pmem_file,
'num_blocks': num_blocks,
'block_size': args.block_size}
return args.client.call('create_pmem_pool', params)
def pmem_pool_info(args):
params = ... | 31.352941 | 66 | 0.684803 |
a854c012226cff8495d0aea0f51b22dcf71c1bea | 4,929 | py | Python | pandas/core/config_init.py | seberg/pandas | 223a1fdd8286f77f1d5c3b3c589816af627d295b | [
"BSD-2-Clause"
] | null | null | null | pandas/core/config_init.py | seberg/pandas | 223a1fdd8286f77f1d5c3b3c589816af627d295b | [
"BSD-2-Clause"
] | null | null | null | pandas/core/config_init.py | seberg/pandas | 223a1fdd8286f77f1d5c3b3c589816af627d295b | [
"BSD-2-Clause"
] | null | null | null | import pandas.core.config as cf
from pandas.core.config import is_int,is_bool,is_text,is_float
from pandas.core.format import detect_console_encoding
"""
This module is imported from the pandas package __init__.py file
in order to ensure that the core.config options registered here will
be available as soon as the use... | 33.080537 | 78 | 0.722256 |
b82e5e935117f34bc652a92eb79f7d65ba2ec48b | 49,033 | py | Python | gui/qt/__init__.py | stevehromov/Electron-Cash | 1d4910d03d547b28c71070672df7ce2ebb67c5dd | [
"MIT"
] | 1 | 2020-06-09T04:01:43.000Z | 2020-06-09T04:01:43.000Z | gui/qt/__init__.py | baby636/Electron-Cash | 2deab3a3b15c9194949199bac662401803c10227 | [
"MIT"
] | 18 | 2019-11-14T03:55:32.000Z | 2020-10-25T10:53:35.000Z | gui/qt/__init__.py | stevehromov/Electron-Cash | 1d4910d03d547b28c71070672df7ce2ebb67c5dd | [
"MIT"
] | 3 | 2019-02-21T07:57:57.000Z | 2020-01-09T15:03:17.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 restr... | 49.880977 | 323 | 0.629923 |
23a527da58027b1912d6d6d4d8a3e5cf2cdf81f8 | 942 | py | Python | 2015/day_23.py | nabiirah/advent-of-code | 9c7e7cae437c024aa05d9cb7f9211fd47f5226a2 | [
"MIT"
] | 24 | 2020-12-08T20:07:52.000Z | 2022-01-18T20:08:06.000Z | 2015/day_23.py | nestorhf/advent-of-code | 1bb827e9ea85e03e0720e339d10b3ed8c44d8f27 | [
"MIT"
] | null | null | null | 2015/day_23.py | nestorhf/advent-of-code | 1bb827e9ea85e03e0720e339d10b3ed8c44d8f27 | [
"MIT"
] | 10 | 2020-12-04T10:04:15.000Z | 2022-02-21T22:22:26.000Z | """Advent of Code Day 23 - Opening the Turing Lock"""
with open('inputs/day_23.txt') as f:
instructions = [line.strip() for line in f]
registers = {'a': 1, 'b': 0} # Change a to 0 for Part One
pos = 0
while pos < len(instructions):
parsed = instructions[pos].split(' ')
if len(parsed) == 3:
if... | 24.789474 | 61 | 0.501062 |
d0cf6c9f1c42fd1aa8a337b2c6b20cc176e70401 | 28,375 | py | Python | train_R3D_CatNet.py | villawang/CatNet | 6f4c3bce7106e55588eecfa9c1ed04bc52bba222 | [
"MIT"
] | 12 | 2020-04-21T21:49:43.000Z | 2022-03-16T05:38:52.000Z | train_R3D_CatNet.py | villawang/CatNet | 6f4c3bce7106e55588eecfa9c1ed04bc52bba222 | [
"MIT"
] | 3 | 2020-10-06T23:39:04.000Z | 2021-12-09T05:37:44.000Z | train_R3D_CatNet.py | villawang/CatNet | 6f4c3bce7106e55588eecfa9c1ed04bc52bba222 | [
"MIT"
] | 2 | 2020-04-21T14:59:30.000Z | 2020-08-11T03:34:31.000Z | import numpy as np
import pickle
import os
from PIL import Image
import time
from tqdm import tqdm, trange
import shutil
from random import randint
import argparse
import glob
import pdb
import random
import math
import time
import argparse
import matplotlib.pyplot as plt
from copy import deepcopy
from... | 45.766129 | 182 | 0.588828 |
bdd5e8e129828164920a6c6fbd77cf246b3947f6 | 7,388 | py | Python | Yoyo/test.py | teabao/AI-introduction | 0a608326f627446011f723201b8f705ad7c77e8c | [
"MIT"
] | null | null | null | Yoyo/test.py | teabao/AI-introduction | 0a608326f627446011f723201b8f705ad7c77e8c | [
"MIT"
] | 1 | 2021-05-19T08:34:44.000Z | 2021-05-19T08:34:44.000Z | Yoyo/test.py | teabao/AI-introduction | 0a608326f627446011f723201b8f705ad7c77e8c | [
"MIT"
] | 1 | 2021-05-19T08:23:28.000Z | 2021-05-19T08:23:28.000Z | import argparse
import gym
import time
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
# from drawnow import drawnow
import matplotlib.pyplot as plt
last_score_plot = [-100]
avg_score_plot = [-100]
def draw_fig():
plt.title('reward')
plt.plo... | 31.172996 | 96 | 0.606253 |
e3faddd5e69246c4361590b6fe169ceb1ca329cb | 871 | py | Python | myaxf/urls.py | Pyrans/test1806 | 1afc62e09bbebf74521b4b6fdafde8eeaa260ed9 | [
"Apache-2.0"
] | null | null | null | myaxf/urls.py | Pyrans/test1806 | 1afc62e09bbebf74521b4b6fdafde8eeaa260ed9 | [
"Apache-2.0"
] | null | null | null | myaxf/urls.py | Pyrans/test1806 | 1afc62e09bbebf74521b4b6fdafde8eeaa260ed9 | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import url
from django.contrib import admin
from .views import *
urlpatterns = [
url(r'^home/', home, name='home'),
url(r'^market/', market, name='market'),
url(r'^cart/', cart, name='cart'),
url(r'^mine/', mine, name='mine'),
url(r'^market_with_params/(\d+)/(\d+)/(\d+)', mar... | 37.869565 | 92 | 0.63031 |
916477a6c7c827adc33128660cf93d7aa22ae997 | 1,804 | py | Python | tests/test_transpile.py | blthree/sqlglot | c3130584db6d767575854ba0d57da37e026863c9 | [
"MIT"
] | null | null | null | tests/test_transpile.py | blthree/sqlglot | c3130584db6d767575854ba0d57da37e026863c9 | [
"MIT"
] | null | null | null | tests/test_transpile.py | blthree/sqlglot | c3130584db6d767575854ba0d57da37e026863c9 | [
"MIT"
] | null | null | null | import os
import unittest
from sqlglot import transpile
class TestTranspile(unittest.TestCase):
file_dir = os.path.dirname(__file__)
fixtures_dir = os.path.join(file_dir, 'fixtures')
def test_comments(self):
sql = transpile('SELECT 1 FROM foo -- comment')[0]
self.assertEqual(sql, 'SELECT ... | 32.214286 | 82 | 0.533259 |
74ee6db22e3da5e381be4b98c9bad3a7e31977c0 | 1,403 | py | Python | corehq/apps/accounting/migrations/0009_make_billingaccount_name_unique.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2020-05-05T13:10:01.000Z | 2020-05-05T13:10:01.000Z | corehq/apps/accounting/migrations/0009_make_billingaccount_name_unique.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2019-12-09T14:00:14.000Z | 2019-12-09T14:00:14.000Z | corehq/apps/accounting/migrations/0009_make_billingaccount_name_unique.py | MaciejChoromanski/commcare-hq | fd7f65362d56d73b75a2c20d2afeabbc70876867 | [
"BSD-3-Clause"
] | 5 | 2015-11-30T13:12:45.000Z | 2019-07-01T19:27:07.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-08-01 21:47
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import migrations, models
from django.db.models import Count
from corehq.apps.accounting.utils import get_account_name_from_default_name
def _make_e... | 32.627907 | 112 | 0.72345 |
3d8420383691bad5db348fe0cf21b10f0da91759 | 6,684 | py | Python | test_code/test_main_unspacer.py | JKamlah/ocromore | f9d302eff234478c98e03740adf6bbeeafe7db8d | [
"Apache-2.0"
] | 16 | 2018-04-20T11:11:18.000Z | 2020-01-14T11:11:59.000Z | test_code/test_main_unspacer.py | JKamlah/ocromore | f9d302eff234478c98e03740adf6bbeeafe7db8d | [
"Apache-2.0"
] | 2 | 2019-09-16T06:22:02.000Z | 2020-08-27T23:11:49.000Z | test_code/test_main_unspacer.py | JKamlah/ocromore | f9d302eff234478c98e03740adf6bbeeafe7db8d | [
"Apache-2.0"
] | 4 | 2019-07-18T18:01:05.000Z | 2020-07-10T18:44:09.000Z | """
This is the starting file for testing unspacing capabilities (was developed before msa_algorithm)
generates unspaced and line height adapted files from different ocr
results and compares them to ground truth
"""
from n_dist_keying.hocr_line_normalizer import HocrLineNormalizer
from n_dist_keying.hocr_bbox... | 45.469388 | 134 | 0.844405 |
44568a63b711952a8695aab87de40ae8c7b3c03d | 12,632 | py | Python | mailchimp_marketing_asyncio/models/open_activity.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | null | null | null | mailchimp_marketing_asyncio/models/open_activity.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | null | null | null | mailchimp_marketing_asyncio/models/open_activity.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | 1 | 2022-03-09T14:52:22.000Z | 2022-03-09T14:52:22.000Z | # coding: utf-8
"""
Mailchimp Marketing API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 3.0.74
Contact: apihelp@mailchimp.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import... | 31.738693 | 224 | 0.611146 |
4e8ab5b14c699aa7e0402c4b0789cd8027c3135e | 138 | py | Python | urlcf/exceptions.py | alkorgun/urlcf | 3d8752ac94b4f57a07f8de2381ffbe53f815ebfb | [
"MIT"
] | 1 | 2017-07-06T02:10:23.000Z | 2017-07-06T02:10:23.000Z | urlcf/exceptions.py | alkorgun/urlcf | 3d8752ac94b4f57a07f8de2381ffbe53f815ebfb | [
"MIT"
] | null | null | null | urlcf/exceptions.py | alkorgun/urlcf | 3d8752ac94b4f57a07f8de2381ffbe53f815ebfb | [
"MIT"
] | null | null | null | """
Created on Nov 17, 2016
@author: alkorgun
"""
class UrlcfError(Exception):
pass
class UIDNotFoundError(UrlcfError):
pass
| 9.857143 | 35 | 0.688406 |
c34bc02ae30160d892fdafb80e7caeec298e7547 | 1,075 | py | Python | h2o-py/h2o/model/__init__.py | kernelrich/h2o-3 | 16bd6be6d0ac22b037cb55b4c647e63e2b112e1e | [
"Apache-2.0"
] | 2 | 2020-09-23T14:23:55.000Z | 2020-09-23T19:26:30.000Z | h2o-py/h2o/model/__init__.py | kernelrich/h2o-3 | 16bd6be6d0ac22b037cb55b4c647e63e2b112e1e | [
"Apache-2.0"
] | 1 | 2021-04-06T13:07:04.000Z | 2021-04-06T13:07:04.000Z | h2o-py/h2o/model/__init__.py | kernelrich/h2o-3 | 16bd6be6d0ac22b037cb55b4c647e63e2b112e1e | [
"Apache-2.0"
] | 1 | 2020-04-17T13:06:26.000Z | 2020-04-17T13:06:26.000Z | from .autoencoder import H2OAutoEncoderModel
from .binomial import H2OBinomialModel
from .clustering import H2OClusteringModel
from .confusion_matrix import ConfusionMatrix
from .dim_reduction import H2ODimReductionModel
from .metrics_base import MetricsBase
from .model_base import ModelBase
from .model_future import H... | 44.791667 | 81 | 0.853023 |
5c4a167ff55b871ef9c337f494458d7b118f4d2b | 1,490 | py | Python | soundrts/worldplayercomputer2.py | fcnjd/soundrts | 3492503d0f4712a31c662d57434ddf8a852d0816 | [
"BSD-3-Clause"
] | 1 | 2021-12-28T20:57:20.000Z | 2021-12-28T20:57:20.000Z | soundrts/worldplayercomputer2.py | fcnjd/soundrts | 3492503d0f4712a31c662d57434ddf8a852d0816 | [
"BSD-3-Clause"
] | 1 | 2018-02-17T10:41:18.000Z | 2018-02-17T10:41:18.000Z | soundrts/worldplayercomputer2.py | fcnjd/soundrts | 3492503d0f4712a31c662d57434ddf8a852d0816 | [
"BSD-3-Clause"
] | null | null | null | from worldorders import ORDERS_DICT
from worldplayerbase import Player
orders = sorted(ORDERS_DICT.keys()) # sort to avoid desync
orders.remove("enter") # later
orders.remove("stop")
orders.remove("attack")
orders.remove("patrol")
orders.remove("wait")
orders.remove("auto_explore")
orders.remove("auto_attack")
orders... | 27.592593 | 77 | 0.637584 |
ea3c994b779a9c5e2c64762029f80fa5cc0998a9 | 8,570 | py | Python | Project 6 Capstone Project/airflow/dag.py | senthilvel-dev/UD_DE | 536cb92f47743b7a52fd62b91845992943965411 | [
"MIT"
] | 42 | 2020-05-22T01:24:33.000Z | 2022-03-28T14:51:13.000Z | Project 6 Capstone Project/airflow/dag.py | senthilvel-dev/UD_DE | 536cb92f47743b7a52fd62b91845992943965411 | [
"MIT"
] | 9 | 2020-12-17T21:21:08.000Z | 2022-03-29T22:29:16.000Z | Project 6 Capstone Project/airflow/dag.py | vineeths96/Data-Engineering-Nanodegree | 4b588607ca654db7e8a2469ab113d4323a1fc079 | [
"MIT"
] | 30 | 2020-05-22T01:19:31.000Z | 2022-03-13T20:06:28.000Z | import datetime
from pathlib import Path
from airflow import DAG
from airflow.models import Variable
from airflow.operators.bash_operator import BashOperator
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.postgres_operator import PostgresOperator
from airflow.operators.s3_to_redshift_... | 35.857741 | 114 | 0.632439 |
017370f2a0f8f69bf4b6af62cf06e1be1d5bded3 | 13,177 | py | Python | thrift/test/py/TestClientServer.py | fakeNetflix/facebook-repo-fbthrift | 24f2357142d1da8c89f4cabc6cb144d83749b3c6 | [
"Apache-2.0"
] | 2 | 2021-06-29T13:42:22.000Z | 2021-09-06T10:57:34.000Z | thrift/test/py/TestClientServer.py | fakeNetflix/facebook-repo-fbthrift | 24f2357142d1da8c89f4cabc6cb144d83749b3c6 | [
"Apache-2.0"
] | null | null | null | thrift/test/py/TestClientServer.py | fakeNetflix/facebook-repo-fbthrift | 24f2357142d1da8c89f4cabc6cb144d83749b3c6 | [
"Apache-2.0"
] | 5 | 2021-06-29T13:42:26.000Z | 2022-02-08T02:41:34.000Z | #!/usr/bin/env python
# This starts up a bunch of servers, one for each of the server type
# and socket typecombinations we have. It then runs through the tests
# for each server, which entails connecting to calling a method on the
# server, asserting something about that method, and then closing the
# connection
fro... | 32.139024 | 77 | 0.629658 |
455700a4c6c5eaf6ed7bafea602e7dfcd0d4a927 | 175 | py | Python | lab_assignment/lab_bla/linux_mac/sample/vector.py | caru1613/introduction_to_python_TEAMLAB_MOOC | e0ac95f7a6b889e7d18b7bdaaab49820e73d5477 | [
"MIT"
] | null | null | null | lab_assignment/lab_bla/linux_mac/sample/vector.py | caru1613/introduction_to_python_TEAMLAB_MOOC | e0ac95f7a6b889e7d18b7bdaaab49820e73d5477 | [
"MIT"
] | null | null | null | lab_assignment/lab_bla/linux_mac/sample/vector.py | caru1613/introduction_to_python_TEAMLAB_MOOC | e0ac95f7a6b889e7d18b7bdaaab49820e73d5477 | [
"MIT"
] | null | null | null | u = [2,2]
v = [2,3]
z = [3,5]
#result = []
#for i in range(len(u)):
# result.append(u[i] + v[i] + z[i])
#print(result)
result = [sum(t) for t in zip(u,v,z)]
print(result) | 15.909091 | 38 | 0.525714 |
569545181dde173594c5bf4600d92d70feec418b | 5,430 | py | Python | tests/3_2_0/blueprints/test_blueprint_having_ahv_helper/blueprint.py | tuxtof/calm-dsl | 5af67435d8304b97e170a690068f2d5975e9bfe6 | [
"Apache-2.0"
] | 37 | 2019-12-23T15:23:20.000Z | 2022-03-15T11:12:11.000Z | tests/3_2_0/blueprints/test_blueprint_having_ahv_helper/blueprint.py | tuxtof/calm-dsl | 5af67435d8304b97e170a690068f2d5975e9bfe6 | [
"Apache-2.0"
] | 144 | 2020-03-09T11:22:09.000Z | 2022-03-28T21:34:09.000Z | tests/3_2_0/blueprints/test_blueprint_having_ahv_helper/blueprint.py | abhijeetkaurav1st/calm-dsl | 6487a896967b3fd667b9320e2ad3a397c9960497 | [
"Apache-2.0"
] | 46 | 2020-01-23T14:28:04.000Z | 2022-03-09T04:17:10.000Z | import json
from calm.dsl.builtins import AhvVmDisk, AhvVmNic, AhvVmGC
from calm.dsl.builtins import ref, AhvVmResources, AhvVm, Ref, Metadata
from calm.dsl.builtins import vm_disk_package, read_local_file, basic_cred
from calm.dsl.builtins import Service, Package, Substrate
from calm.dsl.builtins import Deployment, ... | 26.748768 | 131 | 0.653775 |
93726d765b24143bd88950ebfcd1da8d281de6b5 | 866 | py | Python | csuibot/utils/__init__.py | agungputrap/bribot | 20cb68508b8e2c354c7cb3d527c0997183bd46aa | [
"Apache-2.0"
] | null | null | null | csuibot/utils/__init__.py | agungputrap/bribot | 20cb68508b8e2c354c7cb3d527c0997183bd46aa | [
"Apache-2.0"
] | null | null | null | csuibot/utils/__init__.py | agungputrap/bribot | 20cb68508b8e2c354c7cb3d527c0997183bd46aa | [
"Apache-2.0"
] | null | null | null | from csuibot.utils import zodiac as z
def lookup_zodiac(month, day):
zodiacs = [
z.Aries(),
z.Taurus(),
z.Gemini(),
z.Cancer(),
z.Leo(),
z.Virgo(),
z.Libra(),
z.Scorpio(),
z.Sagittarius(),
z.Capricorn(),
z.Aquarius(),
... | 18.826087 | 44 | 0.473441 |
2573a3cea4554bd2d7faa6c8d0a1ab25c5cd04f5 | 17,466 | py | Python | tests/test_mbgdml_datasets.py | keithgroup/mbGDML | a68b2a41c26c8e7e8e2f4527939c4564402f36bc | [
"MIT"
] | 6 | 2020-08-03T03:44:33.000Z | 2022-02-24T21:50:03.000Z | tests/test_mbgdml_datasets.py | keithgroup/mbGDML | a68b2a41c26c8e7e8e2f4527939c4564402f36bc | [
"MIT"
] | null | null | null | tests/test_mbgdml_datasets.py | keithgroup/mbGDML | a68b2a41c26c8e7e8e2f4527939c4564402f36bc | [
"MIT"
] | 1 | 2022-02-25T03:03:40.000Z | 2022-02-25T03:03:40.000Z | #!/usr/bin/env python
# MIT License
#
# Copyright (c) 2020-2021, Alex M. Maldonado
#
# 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 ri... | 36.236515 | 132 | 0.639643 |
206f36006525514f6654193efce08900327616b0 | 326 | py | Python | lib/utils.py | MusaTamzid05/simple_transfer_learning_lib | adef55fc277268011e526596ad517b68c59c43fb | [
"MIT"
] | null | null | null | lib/utils.py | MusaTamzid05/simple_transfer_learning_lib | adef55fc277268011e526596ad517b68c59c43fb | [
"MIT"
] | null | null | null | lib/utils.py | MusaTamzid05/simple_transfer_learning_lib | adef55fc277268011e526596ad517b68c59c43fb | [
"MIT"
] | null | null | null | import tensorflow as tf
def limit_gpu(memory = 2048):
gpus = tf.config.list_physical_devices('GPU')
if gpus:
try:
tf.config.set_logical_device_configuration(
gpus[0],
[tf.config.LogicalDeviceConfiguration(memory_limit = memory)])
except RuntimeError as e:
pri... | 27.166667 | 74 | 0.647239 |
a6a894239da5504e0612ddb5d578f76fa7bd942e | 1,429 | py | Python | images/python_analysis/src/venv/lib/python3.7/site-packages/elasticsearch/_async/client/graph.py | Jael24/TB_ElasticStack | f9aad11eda69045140a90f28739b558bf077d877 | [
"MIT"
] | 2 | 2021-05-01T05:40:55.000Z | 2021-06-25T13:34:46.000Z | images/python_analysis/src/venv/lib/python3.7/site-packages/elasticsearch/_async/client/graph.py | Jael24/TB_ElasticStack | f9aad11eda69045140a90f28739b558bf077d877 | [
"MIT"
] | 2 | 2021-02-22T14:55:01.000Z | 2021-03-23T12:42:33.000Z | images/python_analysis/src/venv/lib/python3.7/site-packages/elasticsearch/_async/client/graph.py | Jael24/TB_ElasticStack | f9aad11eda69045140a90f28739b558bf077d877 | [
"MIT"
] | 1 | 2021-03-23T12:24:52.000Z | 2021-03-23T12:24:52.000Z | # Licensed to Elasticsearch B.V under one or more agreements.
# Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information
from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH
class GraphClient(NamespacedClient):
... | 42.029412 | 95 | 0.669699 |
6c7e7c64ca5d2041343ebe9528cb6a52563ef2c6 | 1,089 | py | Python | libcst/_nodes/tests/test_trailing_whitespace.py | mvismonte/LibCST | fc430343b5f7e0c30d6d0ca30b5251b74bd3890d | [
"MIT"
] | 1 | 2021-08-12T11:52:00.000Z | 2021-08-12T11:52:00.000Z | libcst/_nodes/tests/test_trailing_whitespace.py | mvismonte/LibCST | fc430343b5f7e0c30d6d0ca30b5251b74bd3890d | [
"MIT"
] | 1 | 2019-08-21T18:58:13.000Z | 2019-08-21T18:58:13.000Z | libcst/_nodes/tests/test_trailing_whitespace.py | mvismonte/LibCST | fc430343b5f7e0c30d6d0ca30b5251b74bd3890d | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-strict
import libcst as cst
from libcst._nodes.tests.base import CSTNodeTest
from libcst.testing.utils import data_provider
class Tra... | 35.129032 | 88 | 0.580349 |
6077d0e195ac760235da3b81067f2a87a604f836 | 94,700 | py | Python | python/mxnet/ndarray/ndarray.py | yinscapital/incubator-mxnet | 4c0df6249d03841f5eb30e1428aa25fc230fed30 | [
"Apache-2.0"
] | null | null | null | python/mxnet/ndarray/ndarray.py | yinscapital/incubator-mxnet | 4c0df6249d03841f5eb30e1428aa25fc230fed30 | [
"Apache-2.0"
] | null | null | null | python/mxnet/ndarray/ndarray.py | yinscapital/incubator-mxnet | 4c0df6249d03841f5eb30e1428aa25fc230fed30 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 31.917762 | 99 | 0.54528 |
ba3a2db20ed39479f4d40ec01c58b455b5d59feb | 1,275 | py | Python | ship.py | favmatteo/navicella-cavallo | 2a785da894399b912e6c35d49298db9bd8aecbd7 | [
"MIT"
] | 5 | 2021-11-09T22:04:48.000Z | 2022-02-08T12:32:31.000Z | ship.py | favmatteo/navicella-cavallo | 2a785da894399b912e6c35d49298db9bd8aecbd7 | [
"MIT"
] | 1 | 2021-11-11T11:16:13.000Z | 2021-11-11T17:26:47.000Z | ship.py | favmatteo/navicella-cavallo | 2a785da894399b912e6c35d49298db9bd8aecbd7 | [
"MIT"
] | 2 | 2021-11-10T10:06:47.000Z | 2022-02-08T12:29:44.000Z | import settings
"""Classe astratta che rappresenta una navicella"""
class Ship:
def __init__(self, x, y):
""" Inizializza gli attributi della classe Ship """
self.x = x
self.y = y
self.ship_img = None
self.laser_img = None
def draw(self, window):
window.blit(... | 23.181818 | 65 | 0.603922 |
82ff8ee9b54f6081d26d30c863eaefde479bd6fd | 1,525 | py | Python | python3/543.diameter-of-binary-tree.248946473.ac.py | Diego-Zulu/leetcode_answers | ad435df1bd95fb2c6e17d2d9ff349282c98ee0f4 | [
"MIT"
] | null | null | null | python3/543.diameter-of-binary-tree.248946473.ac.py | Diego-Zulu/leetcode_answers | ad435df1bd95fb2c6e17d2d9ff349282c98ee0f4 | [
"MIT"
] | null | null | null | python3/543.diameter-of-binary-tree.248946473.ac.py | Diego-Zulu/leetcode_answers | ad435df1bd95fb2c6e17d2d9ff349282c98ee0f4 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=543 lang=python3
#
# [543] Diameter of Binary Tree
#
# https://leetcode.com/problems/diameter-of-binary-tree/description/
#
# algorithms
# Easy (47.98%)
# Likes: 2733
# Dislikes: 176
# Total Accepted: 308.1K
# Total Submissions: 642K
# Testcase Example: '[1,2,3,4,5]'
#
#
# Given a binary... | 23.461538 | 79 | 0.630164 |
0091861d3bbc3164a84bbec6f99ee0ab32808ad0 | 1,958 | py | Python | astropath/utilities/units/core.py | AstroPathJHU/AstroPathPipeline | 3b0d9cdad18b84e55d00724f89f09bc7f7464c98 | [
"Apache-2.0"
] | 14 | 2021-06-14T05:05:58.000Z | 2022-01-15T14:07:30.000Z | astropath/utilities/units/core.py | AstroPathJHU/AstroPathPipeline | 3b0d9cdad18b84e55d00724f89f09bc7f7464c98 | [
"Apache-2.0"
] | null | null | null | astropath/utilities/units/core.py | AstroPathJHU/AstroPathPipeline | 3b0d9cdad18b84e55d00724f89f09bc7f7464c98 | [
"Apache-2.0"
] | 2 | 2021-08-14T16:22:50.000Z | 2022-01-16T17:47:07.000Z | import abc, methodtools
currentmodule = None
class UnitsError(Exception): pass
class Distance:
def __new__(self, *args, **kwargs):
return currentmodule.Distance(*args, **kwargs)
def onepixel(pscale):
return Distance(pixels=1, pscale=pscale)
def onemicron(pscale):
return Distance(microns=1, pscale=pscale)
... | 27.577465 | 93 | 0.755363 |
72066d210c04ec6e8a86e8afac14680c0da51efe | 403 | py | Python | setup.py | urielka/pydds-rti-xml | 15ad015420a966284203afa4e115e2871565d4ad | [
"MIT"
] | null | null | null | setup.py | urielka/pydds-rti-xml | 15ad015420a966284203afa4e115e2871565d4ad | [
"MIT"
] | null | null | null | setup.py | urielka/pydds-rti-xml | 15ad015420a966284203afa4e115e2871565d4ad | [
"MIT"
] | 1 | 2018-06-29T06:39:52.000Z | 2018-06-29T06:39:52.000Z | from setuptools import setup, find_packages
import os
setup(name='pydds-rti-xml',
version='0.2.0',
description='Python wrapper for RTI DDS with XML application support',
author='Uriel Katz',
author_email='uriel.katz@gmail.com',
url='https://github.com/urielka/pydds-rti-xml',
includ... | 26.866667 | 76 | 0.672457 |
daff1307f9ed9f8bbc3337df298f90d55c7b880e | 537 | py | Python | rx3/core/operators/publishvalue.py | samiur/RxPY | ea6b3554ab06cfc70e28b532c0a54b910b6ee470 | [
"MIT"
] | null | null | null | rx3/core/operators/publishvalue.py | samiur/RxPY | ea6b3554ab06cfc70e28b532c0a54b910b6ee470 | [
"MIT"
] | null | null | null | rx3/core/operators/publishvalue.py | samiur/RxPY | ea6b3554ab06cfc70e28b532c0a54b910b6ee470 | [
"MIT"
] | null | null | null | from typing import Any, Callable, Optional
from rx3 import operators as ops
from rx3.core import Observable
from rx3.subject import BehaviorSubject
from rx3.core.typing import Mapper
def _publish_value(initial_value: Any, mapper: Optional[Mapper] = None) -> Callable[[Observable], Observable]:
if mapper:
... | 33.5625 | 110 | 0.769088 |
066426649ff57fc38e87551fc2b4e62e6bf45bc9 | 7,022 | py | Python | src/utils.py | asafjo23/outliers-detection | dd78e3161c02a2f8ae685ef31ad796787e305591 | [
"MIT"
] | null | null | null | src/utils.py | asafjo23/outliers-detection | dd78e3161c02a2f8ae685ef31ad796787e305591 | [
"MIT"
] | 4 | 2022-03-28T08:53:39.000Z | 2022-03-28T09:00:27.000Z | src/utils.py | asafjo23/outliers-detection | dd78e3161c02a2f8ae685ef31ad796787e305591 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
from pandas import DataFrame, Series
from scipy.sparse import csr_matrix
from torch import Tensor, sum, LongTensor, FloatTensor, histc
from sklearn.metrics.pairwise import cosine_similarity
from collections import namedtuple
from typing import Tuple, Mapping
from torch.nn import P... | 41.305882 | 100 | 0.697664 |
85e19c9cc95d2e3e452e7b929ebadf08162bf3e5 | 2,469 | py | Python | cogs/verify.py | xspo-oky/iris-test | a4cc15cd590c4ba9b78276565281ca6984be7bef | [
"MIT"
] | null | null | null | cogs/verify.py | xspo-oky/iris-test | a4cc15cd590c4ba9b78276565281ca6984be7bef | [
"MIT"
] | null | null | null | cogs/verify.py | xspo-oky/iris-test | a4cc15cd590c4ba9b78276565281ca6984be7bef | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
import config
import asyncio
from discord.utils import get
import random
class Verify(commands.Cog):
def __init__(self, client):
self.client = client
@commands.Cog.listener()
async def on_message(self, message):
if message.channel.id == config.verifyChann... | 34.291667 | 116 | 0.669097 |
72bfc5ba377adecf88c8721fbcab413e202c929a | 669 | py | Python | URI Online Judge/Practice/question1049.py | kushagra1212/Competitive-Programming | 5b68774c617d6abdf1b29893b1b13d47f62161e8 | [
"MIT"
] | 994 | 2017-02-28T06:13:47.000Z | 2022-03-31T10:49:00.000Z | Practice/UriOnlineJudge/question1049.py | devesh17m/Competitive-Programming | 2d459dc8dc5ac628d94700b739988b0ea364cb71 | [
"MIT"
] | 16 | 2018-01-01T02:59:55.000Z | 2021-11-22T12:49:16.000Z | Practice/UriOnlineJudge/question1049.py | devesh17m/Competitive-Programming | 2d459dc8dc5ac628d94700b739988b0ea364cb71 | [
"MIT"
] | 325 | 2017-06-15T03:32:43.000Z | 2022-03-28T22:43:42.000Z | # coding: utf-8
classificacao = raw_input()
tipo = raw_input()
especie = raw_input()
if (classificacao == "vertebrado"):
if(tipo == "ave"):
if (especie == "carnivoro"):
print("aguia")
elif(especie == "onivoro"):
print("pomba")
elif (tipo == "mamifero"):
if (especie == "onivoro"):
print("homem")
el... | 20.90625 | 38 | 0.605381 |
3ad1db2daf37d07310381dbbb814eddb95195e0c | 859 | py | Python | setup.py | nielsdrost/pymt | ae39bf807428827a6904202bf4d3b927daa255ea | [
"MIT"
] | null | null | null | setup.py | nielsdrost/pymt | ae39bf807428827a6904202bf4d3b927daa255ea | [
"MIT"
] | null | null | null | setup.py | nielsdrost/pymt | ae39bf807428827a6904202bf4d3b927daa255ea | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
import versioneer
def read_requirements():
import os
path = os.path.dirname(os.path.abspath(__file__))
requirements_file = os.path.join(path, "requirements.txt")
try:
with open(requirements_file, "r") as req_fp:
requires = req_fp.read()... | 26.84375 | 77 | 0.675204 |
777063b782c6df91ae36400652cb0dcd4d91ed40 | 6,064 | py | Python | pirates/piratesgui/PDialog.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 81 | 2018-04-08T18:14:24.000Z | 2022-01-11T07:22:15.000Z | pirates/piratesgui/PDialog.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 4 | 2018-09-13T20:41:22.000Z | 2022-01-08T06:57:00.000Z | pirates/piratesgui/PDialog.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 26 | 2018-05-26T12:49:27.000Z | 2021-09-11T09:11:59.000Z | from pandac.PandaModules import TextNode
from direct.gui.DirectGui import *
from direct.directnotify import DirectNotifyGlobal
from otp.otpgui import OTPDialog
from pirates.piratesbase import PLocalizer
from pirates.piratesgui import BorderFrame
from pirates.piratesgui import PiratesGuiGlobals
class PDialog(DirectDial... | 50.533333 | 1,215 | 0.64215 |
9fc2fb585ab81aff14a51d613814ecebc401f77f | 30,543 | py | Python | numba/tests/test_typedlist.py | Rubtsowa/numba | 6d7cddb9084d843e12bcdf9c443bc9cce56aa02f | [
"BSD-2-Clause"
] | null | null | null | numba/tests/test_typedlist.py | Rubtsowa/numba | 6d7cddb9084d843e12bcdf9c443bc9cce56aa02f | [
"BSD-2-Clause"
] | null | null | null | numba/tests/test_typedlist.py | Rubtsowa/numba | 6d7cddb9084d843e12bcdf9c443bc9cce56aa02f | [
"BSD-2-Clause"
] | null | null | null | from __future__ import print_function, absolute_import, division
from itertools import product
import numpy as np
from numba import njit
from numba import int32, float32, types, prange
from numba import jitclass, typeof
from numba.typed import List, Dict
from numba.utils import IS_PY3
from .support import (TestCase,... | 29.827148 | 80 | 0.528042 |
4d5d10f090adbbffaaa58792e17aa0f290ae1ab8 | 371 | py | Python | tests/test_modules/test_ADOdin/test_adodin_blocks.py | aaron-parsons/pymalcolm | 4e7ebd6b09382ab7e013278a81097d17873fa5c4 | [
"Apache-2.0"
] | null | null | null | tests/test_modules/test_ADOdin/test_adodin_blocks.py | aaron-parsons/pymalcolm | 4e7ebd6b09382ab7e013278a81097d17873fa5c4 | [
"Apache-2.0"
] | null | null | null | tests/test_modules/test_ADOdin/test_adodin_blocks.py | aaron-parsons/pymalcolm | 4e7ebd6b09382ab7e013278a81097d17873fa5c4 | [
"Apache-2.0"
] | null | null | null | from mock import Mock
from malcolm.testutil import ChildTestCase
from malcolm.modules.ADOdin.blocks import odin_runnable_block
class TestADOdinBlocks(ChildTestCase):
def test_odin_detector_runnable_block(self):
self.create_child_block(
odin_runnable_block, Mock(),
mri_prefix="mri_... | 30.916667 | 78 | 0.757412 |
8ffa61871dece7c31eb6c5f5e5f9b2ec161d9ef9 | 2,343 | py | Python | docs/conf.py | Lesson-ThienHi/thienhi_shop | 1c595d70299e1fcce12c3610e27b66c89bbadda6 | [
"MIT"
] | null | null | null | docs/conf.py | Lesson-ThienHi/thienhi_shop | 1c595d70299e1fcce12c3610e27b66c89bbadda6 | [
"MIT"
] | 2 | 2022-03-30T06:34:29.000Z | 2022-03-31T06:34:49.000Z | docs/conf.py | Lesson-ThienHi/thienhi_shop | 1c595d70299e1fcce12c3610e27b66c89bbadda6 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 36.609375 | 79 | 0.668374 |
5d3a7a4c828e00572f691871f5959cb379c716a9 | 3,021 | py | Python | tests/test_cli.py | OasisLMF/OEDtransform | 688a9cf90a7f11ee19f5f48fcbe1cb93962ea67d | [
"BSD-3-Clause"
] | 1 | 2022-03-18T14:53:27.000Z | 2022-03-18T14:53:27.000Z | tests/test_cli.py | OasisLMF/OpenDataTransform | 688a9cf90a7f11ee19f5f48fcbe1cb93962ea67d | [
"BSD-3-Clause"
] | 25 | 2021-08-05T16:17:24.000Z | 2022-03-29T16:28:35.000Z | tests/test_cli.py | OasisLMF/OEDtransform | 688a9cf90a7f11ee19f5f48fcbe1cb93962ea67d | [
"BSD-3-Clause"
] | 1 | 2022-01-21T14:39:20.000Z | 2022-01-21T14:39:20.000Z | from unittest import mock
import yaml
from click.testing import CliRunner
from hypothesis import given
from hypothesis.strategies import fixed_dictionaries, just, one_of, tuples
from converter.cli import cli
from converter.config import Config
from converter.mapping import BaseMapping
from converter.runner import Bas... | 28.771429 | 78 | 0.602119 |
3a9ffb2008dcbe723586d855dd457ac4f001297d | 1,087 | py | Python | pyNastran/gui/dev/save_load.py | ACea15/pyNastran | 5ffc37d784b52c882ea207f832bceb6b5eb0e6d4 | [
"BSD-3-Clause"
] | 293 | 2015-03-22T20:22:01.000Z | 2022-03-14T20:28:24.000Z | pyNastran/gui/dev/save_load.py | ACea15/pyNastran | 5ffc37d784b52c882ea207f832bceb6b5eb0e6d4 | [
"BSD-3-Clause"
] | 512 | 2015-03-14T18:39:27.000Z | 2022-03-31T16:15:43.000Z | pyNastran/gui/dev/save_load.py | ACea15/pyNastran | 5ffc37d784b52c882ea207f832bceb6b5eb0e6d4 | [
"BSD-3-Clause"
] | 136 | 2015-03-19T03:26:06.000Z | 2022-03-25T22:14:54.000Z | import json
data = {
'completed_in': 0.074,
'max_id': 264043230692245504,
'max_id_str': '264043230692245504',
'next_page': '?page=2&max_id=264043230692245504&q=python&rpp=5',
'page': 1,
'query': 'python',
'refresh_url': '?since_id=264043230692245504&q=python',
'results': [
{'crea... | 27.175 | 68 | 0.546458 |
9549cdbee430a202bf0c02a19fc0dd13d6b22edf | 42 | py | Python | IDE/Missup.py | Xpliot/IDE | 7b9b3debf8d5369f8ac6747fb46f5be25d3cfca1 | [
"MIT"
] | null | null | null | IDE/Missup.py | Xpliot/IDE | 7b9b3debf8d5369f8ac6747fb46f5be25d3cfca1 | [
"MIT"
] | null | null | null | IDE/Missup.py | Xpliot/IDE | 7b9b3debf8d5369f8ac6747fb46f5be25d3cfca1 | [
"MIT"
] | null | null | null | def add(a,b):
return a+b
add(54+23)
| 8.4 | 14 | 0.547619 |
055431ee8ee3ac14676fbfaf01642c79a03e6139 | 678 | py | Python | django_redux/engine.py | fcurella/django_redux | 0215fcd09cd02049778e98d77467d4900c62b8c2 | [
"BSD-3-Clause"
] | 42 | 2017-02-15T13:39:41.000Z | 2019-06-24T17:59:35.000Z | django_redux/engine.py | channels-frontend/django_redux | 0215fcd09cd02049778e98d77467d4900c62b8c2 | [
"BSD-3-Clause"
] | 3 | 2019-08-19T19:35:23.000Z | 2022-02-26T16:46:54.000Z | django_redux/engine.py | channels-frontend/django_redux | 0215fcd09cd02049778e98d77467d4900c62b8c2 | [
"BSD-3-Clause"
] | 4 | 2017-06-28T18:35:21.000Z | 2019-01-20T14:49:29.000Z | from channels.layers import get_channel_layer
async def send_action(group_name, action):
"""
Convenience method to dispatch redux actions from channels.
Usage::
send_action("group_name", {
"type": "MY_ACTION",
"payload": {
"id": 1,
"name": ... | 18.833333 | 63 | 0.538348 |
40502351eaf29688fab9e182e67fd1cd214d5167 | 196 | py | Python | rhea/cores/usbext/fpgalink/__init__.py | meetps/rhea | f8a9a08fb5e14c5c4488ef68a2dff4d18222c2c0 | [
"MIT"
] | 1 | 2022-03-16T23:56:09.000Z | 2022-03-16T23:56:09.000Z | rhea/cores/usbext/fpgalink/__init__.py | meetps/rhea | f8a9a08fb5e14c5c4488ef68a2dff4d18222c2c0 | [
"MIT"
] | null | null | null | rhea/cores/usbext/fpgalink/__init__.py | meetps/rhea | f8a9a08fb5e14c5c4488ef68a2dff4d18222c2c0 | [
"MIT"
] | null | null | null |
from __future__ import absolute_import
from . import _fpgalink_fx2 as fpgalink
from ._fpgalink_fx2 import get_interfaces
from ._fpgalink_fx2 import fpgalink_fx2
from ._fl_convert import convert
| 24.5 | 41 | 0.857143 |
f0c8340e9b6f928085a100a3d56bf3541cf1d7f3 | 900 | py | Python | telegram_gcloner/handlers/cancel.py | Selena-of/ClonBot | 22a291a8a56c6bb33596f7c9cecd2857e78ec55e | [
"MIT"
] | 79 | 2021-04-06T16:14:37.000Z | 2022-03-31T06:35:50.000Z | telegram_gcloner/handlers/cancel.py | Selena-of/ClonBot | 22a291a8a56c6bb33596f7c9cecd2857e78ec55e | [
"MIT"
] | 1 | 2021-05-01T14:03:21.000Z | 2021-11-18T18:29:44.000Z | telegram_gcloner/handlers/cancel.py | Selena-of/ClonBot | 22a291a8a56c6bb33596f7c9cecd2857e78ec55e | [
"MIT"
] | 184 | 2021-04-06T16:14:38.000Z | 2022-03-31T06:35:52.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import logging
from telegram.ext import Dispatcher, CallbackQueryHandler
from utils.helper import alert_users
from utils.restricted import restricted
logger = logging.getLogger(__name__)
def init(dispatcher: Dispatcher):
"""Provide handlers initialization... | 31.034483 | 82 | 0.703333 |
1e03eadfb95d1b9182301855a5865086b87ad09d | 598 | py | Python | tests/_testsite/urls.py | kapt-labs/django-cross-site-urls-gitlab | b0d7415ee0f86e64c71d50ccea73f9c4a46e8768 | [
"BSD-3-Clause"
] | 1 | 2016-03-01T20:49:18.000Z | 2016-03-01T20:49:18.000Z | tests/_testsite/urls.py | kapt-labs/django-cross-site-urls-gitlab | b0d7415ee0f86e64c71d50ccea73f9c4a46e8768 | [
"BSD-3-Clause"
] | null | null | null | tests/_testsite/urls.py | kapt-labs/django-cross-site-urls-gitlab | b0d7415ee0f86e64c71d50ccea73f9c4a46e8768 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.conf.urls import include
from django.conf.urls.i18n import i18n_patterns
from django.conf.urls import url
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
# Local application / specific lib... | 27.181818 | 95 | 0.794314 |
f8d4f57addaa672900b4eb6bed569aa75c240016 | 18,467 | py | Python | scripts/audio_thread_log_viewer/viewer_c3.py | TinkerBoard-Android/external-adhd | ffc625793b55ea7f8e511b9362a88b6ba080c983 | [
"BSD-1-Clause",
"BSD-3-Clause"
] | 1 | 2021-03-08T11:49:58.000Z | 2021-03-08T11:49:58.000Z | scripts/audio_thread_log_viewer/viewer_c3.py | TinkerBoard-Android/external-adhd | ffc625793b55ea7f8e511b9362a88b6ba080c983 | [
"BSD-1-Clause",
"BSD-3-Clause"
] | 1 | 2021-03-23T18:17:08.000Z | 2021-03-23T18:17:08.000Z | scripts/audio_thread_log_viewer/viewer_c3.py | TinkerBoard-Android/external-adhd | ffc625793b55ea7f8e511b9362a88b6ba080c983 | [
"BSD-1-Clause",
"BSD-3-Clause"
] | 1 | 2016-10-19T08:33:40.000Z | 2016-10-19T08:33:40.000Z | #!/usr/bin/python
#
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
"""Generates an HTML file with plot of buffer level in the audio thread log."""
import argparse
import collections
import logging
i... | 30.523967 | 116 | 0.586722 |
6ee75387f7debd95d17fe3c3b04f51af21a58b44 | 66 | py | Python | tokenfe/task/tests.py | jameem-pixel/ticketproject | d8ae4c3a0dc924bc99d8ba50eaa722935710ef93 | [
"Apache-2.0"
] | null | null | null | tokenfe/task/tests.py | jameem-pixel/ticketproject | d8ae4c3a0dc924bc99d8ba50eaa722935710ef93 | [
"Apache-2.0"
] | null | null | null | tokenfe/task/tests.py | jameem-pixel/ticketproject | d8ae4c3a0dc924bc99d8ba50eaa722935710ef93 | [
"Apache-2.0"
] | 1 | 2022-01-22T18:58:20.000Z | 2022-01-22T18:58:20.000Z | from django.test import TestCase
# Create your tests here.
| 16.5 | 33 | 0.712121 |
ca880b599c44d8861e1b3e9e7a2aab49c55c473e | 31,913 | py | Python | time_series/Lib/site-packages/statsmodels/discrete/count_model.py | Evans-colon/Time_Series_Analysis_Forcasting | cf7229d8558013ffcff0780b5ba7a2e2b95d7253 | [
"MIT"
] | null | null | null | time_series/Lib/site-packages/statsmodels/discrete/count_model.py | Evans-colon/Time_Series_Analysis_Forcasting | cf7229d8558013ffcff0780b5ba7a2e2b95d7253 | [
"MIT"
] | 5 | 2022-02-13T14:38:04.000Z | 2022-02-15T00:13:07.000Z | time_series/Lib/site-packages/statsmodels/discrete/count_model.py | Evans-colon/Time_Series_Analysis_Forcasting | cf7229d8558013ffcff0780b5ba7a2e2b95d7253 | [
"MIT"
] | 4 | 2022-02-04T22:58:27.000Z | 2022-02-14T19:29:18.000Z | __all__ = ["ZeroInflatedPoisson", "ZeroInflatedGeneralizedPoisson",
"ZeroInflatedNegativeBinomialP"]
import warnings
import numpy as np
import statsmodels.base.model as base
import statsmodels.base.wrapper as wrap
import statsmodels.regression.linear_model as lm
from statsmodels.discrete.discrete_model impo... | 38.264988 | 98 | 0.59681 |
07b529e7a720807fc3252b20de3680d9007dab6e | 343 | py | Python | test/word_store/test_construction.py | AndrewWasHere/passphrase_generator | 8db3b833401036fc6db4ed2b9dc7980e5fec525c | [
"BSD-3-Clause"
] | null | null | null | test/word_store/test_construction.py | AndrewWasHere/passphrase_generator | 8db3b833401036fc6db4ed2b9dc7980e5fec525c | [
"BSD-3-Clause"
] | null | null | null | test/word_store/test_construction.py | AndrewWasHere/passphrase_generator | 8db3b833401036fc6db4ed2b9dc7980e5fec525c | [
"BSD-3-Clause"
] | null | null | null | """
Copyright 2017, Andrew Lin
All rights reserved.
This software is licensed under the BSD 3-Clause License.
See LICENSE.txt at the root of the project or
https://opensource.org/licenses/BSD-3-Clause
"""
from passphrase.word_store import WordStore
def test_nominal():
words = WordStore()
assert len(list(wor... | 21.4375 | 57 | 0.74344 |
7526daa6f0b263e555f30adc5e6af3be286474cf | 7,647 | py | Python | vis_sv/vis_sv_z1000_L1.py | danforthcenter/plantcv-dev-scripts | 57ebc9a031b7141b8965c927c3b7b01ba6504dc1 | [
"MIT"
] | null | null | null | vis_sv/vis_sv_z1000_L1.py | danforthcenter/plantcv-dev-scripts | 57ebc9a031b7141b8965c927c3b7b01ba6504dc1 | [
"MIT"
] | null | null | null | vis_sv/vis_sv_z1000_L1.py | danforthcenter/plantcv-dev-scripts | 57ebc9a031b7141b8965c927c3b7b01ba6504dc1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys, traceback
import cv2
import numpy as np
import argparse
import string
import plantcv as pcv
### Parse command-line arguments
def options():
parser = argparse.ArgumentParser(description="Imaging processing with opencv")
parser.add_argument("-i", "--image", help="Input image file.",... | 52.737931 | 168 | 0.741729 |
7a5ed1592d9b05c8a304a27c939a38020c2b340f | 2,114 | py | Python | warpseq/model/instrument.py | simian-terminal/warpseq | f61e68d1e6a9ad15a5e0c899237be784bcff7093 | [
"Apache-2.0"
] | 3 | 2021-01-22T01:20:20.000Z | 2022-03-10T20:58:42.000Z | warpseq/model/instrument.py | simian-terminal/warpseq | f61e68d1e6a9ad15a5e0c899237be784bcff7093 | [
"Apache-2.0"
] | 1 | 2020-08-11T07:21:05.000Z | 2020-08-11T07:21:05.000Z | warpseq/model/instrument.py | simianterminal/warpseq | f61e68d1e6a9ad15a5e0c899237be784bcff7093 | [
"Apache-2.0"
] | null | null | null | # ------------------------------------------------------------------
# Warp Sequencer
# (C) 2020 Michael DeHaan <michael@michaeldehaan.net> & contributors
# Apache2 Licensed
# ------------------------------------------------------------------
# an instrument adds a channel number to a MIDI device and has some
# parame... | 34.096774 | 153 | 0.569536 |
375630a1da1c56e360aae35470702f17b9ba31a7 | 2,806 | py | Python | lib/exabgp/bgp/message/update/attribute/bgpls/prefix/srprefix.py | fser/exabgp | 9a41b5f833a00a4d56b1a38f73858d62685065dd | [
"BSD-3-Clause"
] | 2 | 2018-02-07T14:49:11.000Z | 2021-09-08T15:31:51.000Z | lib/exabgp/bgp/message/update/attribute/bgpls/prefix/srprefix.py | fser/exabgp | 9a41b5f833a00a4d56b1a38f73858d62685065dd | [
"BSD-3-Clause"
] | null | null | null | lib/exabgp/bgp/message/update/attribute/bgpls/prefix/srprefix.py | fser/exabgp | 9a41b5f833a00a4d56b1a38f73858d62685065dd | [
"BSD-3-Clause"
] | 1 | 2018-12-19T18:02:59.000Z | 2018-12-19T18:02:59.000Z | # encoding: utf-8
"""
srprefix.py
Created by Evelio Vila
Copyright (c) 2014-2017 Exa Networks. All rights reserved.
"""
import json
from struct import unpack
from exabgp.vendoring import six
from exabgp.vendoring.bitstring import BitArray
from exabgp.bgp.message.notification import Notify
from exabgp.bgp.message.upd... | 35.518987 | 89 | 0.556664 |
617b37d997a3cd28c041baae49d52cf26bc290f1 | 220 | py | Python | arrays/first_not_repeating_char.py | nickaigi/automatic-dollop | eb8222475c7871c1d5710242c5aed8c70ea0d2c8 | [
"Unlicense"
] | null | null | null | arrays/first_not_repeating_char.py | nickaigi/automatic-dollop | eb8222475c7871c1d5710242c5aed8c70ea0d2c8 | [
"Unlicense"
] | null | null | null | arrays/first_not_repeating_char.py | nickaigi/automatic-dollop | eb8222475c7871c1d5710242c5aed8c70ea0d2c8 | [
"Unlicense"
] | null | null | null | def first_not_repeating_character(s):
for c in s:
if s.index(c) == s.rindex(c):
return c
return '_'
if __name__ == '__main__':
s = 'abacabad'
print(first_not_repeating_character(s))
| 20 | 43 | 0.604545 |
d86b1b6c0bb04edd6cec2877caf04b99efefba37 | 1,629 | py | Python | tests/neox_args/test_neoxargs_usage.py | igor0/gpt-neox | 3ad61952c290669d3741c01f767d41fdee5215c5 | [
"Apache-2.0"
] | 1,871 | 2020-12-22T14:44:29.000Z | 2022-03-31T14:21:40.000Z | tests/neox_args/test_neoxargs_usage.py | igor0/gpt-neox | 3ad61952c290669d3741c01f767d41fdee5215c5 | [
"Apache-2.0"
] | 300 | 2020-12-23T17:51:43.000Z | 2022-03-30T17:34:42.000Z | tests/neox_args/test_neoxargs_usage.py | igor0/gpt-neox | 3ad61952c290669d3741c01f767d41fdee5215c5 | [
"Apache-2.0"
] | 235 | 2020-12-23T19:45:19.000Z | 2022-03-31T20:33:47.000Z | """
plausibility check for the usage of neox_args in the megatron codebase
"""
import pytest
import re
from ..common import get_root_directory
@pytest.mark.cpu
def test_neoxargs_usage():
""""
checks for code pieces of the pattern "args.*" and verifies that such used arg is defined in NeoXArgs
"""
from... | 38.785714 | 265 | 0.666053 |
a2b9d5671ae53cbefb3e73e2c4ecc597b6ae1fc8 | 1,209 | py | Python | 13_async_development/sample_code/8_queued_no_waits.py | gdia/The-Complete-Python-Course | ed375b65242249bc749c3e292a6149f8528b9dcf | [
"MIT"
] | 29 | 2019-09-02T21:15:59.000Z | 2022-01-14T02:20:05.000Z | 13_async_development/sample_code/8_queued_no_waits.py | gdia/The-Complete-Python-Course | ed375b65242249bc749c3e292a6149f8528b9dcf | [
"MIT"
] | 2 | 2020-08-20T05:48:36.000Z | 2021-06-02T03:16:31.000Z | 13_async_development/sample_code/8_queued_no_waits.py | gdia/The-Complete-Python-Course | ed375b65242249bc749c3e292a6149f8528b9dcf | [
"MIT"
] | 38 | 2019-10-20T14:29:12.000Z | 2022-03-27T19:50:05.000Z | import time
import random
import queue
from threading import Thread # still needed for daemon threads
from concurrent.futures import ThreadPoolExecutor
counter = 0
job_queue = queue.Queue()
counter_queue = queue.Queue()
def increment_manager():
global counter
while True:
increment = counter_queue.get() # this... | 26.866667 | 94 | 0.762614 |
85d195d594a710336938dcda953fb7fbeae1bb79 | 3,782 | py | Python | prodmanager/settings.py | georgiawang5332/prodmanager | 5dbff0789deb0c4f696149345ded3e338c6f59ec | [
"MIT"
] | null | null | null | prodmanager/settings.py | georgiawang5332/prodmanager | 5dbff0789deb0c4f696149345ded3e338c6f59ec | [
"MIT"
] | null | null | null | prodmanager/settings.py | georgiawang5332/prodmanager | 5dbff0789deb0c4f696149345ded3e338c6f59ec | [
"MIT"
] | null | null | null | """
Django settings for prodmanager project.
Generated by 'django-admin startproject' using Django 3.1.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
from pathl... | 26.447552 | 104 | 0.724484 |
f7954dc876348518f9d557b91d1e863ed39cd3dc | 2,682 | py | Python | shop/shipping/modifiers.py | r4co0n/django-shop | 69cbddba27066568920cce177511c95824bfe45b | [
"BSD-3-Clause"
] | null | null | null | shop/shipping/modifiers.py | r4co0n/django-shop | 69cbddba27066568920cce177511c95824bfe45b | [
"BSD-3-Clause"
] | 5 | 2021-03-19T16:04:13.000Z | 2022-01-13T03:35:33.000Z | shop/shipping/modifiers.py | r4co0n/django-shop | 69cbddba27066568920cce177511c95824bfe45b | [
"BSD-3-Clause"
] | 1 | 2020-07-06T05:06:05.000Z | 2020-07-06T05:06:05.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from shop.modifiers.base import BaseCartModifier
class ShippingModifier(BaseCartModifier):
"""
Base class for all shipping modifiers.
"""
def get_c... | 35.289474 | 98 | 0.65399 |
f77a7e41120a37ce5a2f05432c49db923c877116 | 1,486 | py | Python | simpleh5/tests/test_simpleh5_search_util.py | ssolari/simpleh5 | 0c82395f5144634221419ff347db23ef4d34cd04 | [
"MIT"
] | null | null | null | simpleh5/tests/test_simpleh5_search_util.py | ssolari/simpleh5 | 0c82395f5144634221419ff347db23ef4d34cd04 | [
"MIT"
] | null | null | null | simpleh5/tests/test_simpleh5_search_util.py | ssolari/simpleh5 | 0c82395f5144634221419ff347db23ef4d34cd04 | [
"MIT"
] | null | null | null |
import unittest
import os
from simpleh5.utilities.search_utilities import _build_search_string
class TestBuildString(unittest.TestCase):
def test_string_single(self):
query = ['strs', '==', 'abc']
match_string, uservars = _build_search_string(query)
self.assertEqual(match_string, "(n0=... | 30.326531 | 89 | 0.560565 |
9cd5b7957823e02e9cd7b6b090f21f29c565b07a | 802 | py | Python | api/source/models/option.py | 1pkg/ReRe | 83f77d2cece0fb5f6d7b86a395fcca7d4e16459f | [
"MIT"
] | 1 | 2019-12-17T10:31:48.000Z | 2019-12-17T10:31:48.000Z | api/source/models/option.py | c-pkg/ReRe | 83f77d2cece0fb5f6d7b86a395fcca7d4e16459f | [
"MIT"
] | null | null | null | api/source/models/option.py | c-pkg/ReRe | 83f77d2cece0fb5f6d7b86a395fcca7d4e16459f | [
"MIT"
] | 1 | 2019-04-29T08:19:36.000Z | 2019-04-29T08:19:36.000Z | from base import Alchemy
class Option(Alchemy.Model):
__tablename__ = 'option'
id = Alchemy.Column(
Alchemy.Integer,
nullable=False,
primary_key=True,
)
name = Alchemy.Column(
Alchemy.String,
nullable=False,
unique=True,
)
description = Alchemy.... | 19.560976 | 36 | 0.562344 |
ebfa2f6b03db0b30d80056918a698118b714de25 | 253 | py | Python | tests/exceptions/source/others/handler_formatting_with_context_manager.py | joshgordon/loguru | 9777f4bec8b03ef074635269224baa3fd263fd09 | [
"MIT"
] | 2 | 2020-01-20T10:03:24.000Z | 2020-02-05T03:38:25.000Z | tests/exceptions/source/others/handler_formatting_with_context_manager.py | joshgordon/loguru | 9777f4bec8b03ef074635269224baa3fd263fd09 | [
"MIT"
] | 1 | 2021-01-31T07:28:51.000Z | 2021-02-21T08:38:53.000Z | tests/exceptions/source/others/handler_formatting_with_context_manager.py | joshgordon/loguru | 9777f4bec8b03ef074635269224baa3fd263fd09 | [
"MIT"
] | 3 | 2020-02-05T03:38:28.000Z | 2020-02-11T02:34:56.000Z | import sys
from loguru import logger
logger.remove()
logger.add(
sys.stderr,
format="{name} {file.name} {function} {line}",
diagnose=False,
backtrace=False,
colorize=False,
)
def a():
with logger.catch():
1 / 0
a()
| 12.047619 | 50 | 0.604743 |
cd7b6b0a2f2c2d1cd94a529ea300dcfba5c891e3 | 1,150 | py | Python | dataxHWSp2021/HW2_CoreConcepts/student/tests/q3b.py | UCBerkeley-SCET/DataX-Berkeley | f912d22c838b511d3ada4ecfa3548afd80437b74 | [
"Apache-2.0"
] | 28 | 2020-06-15T23:53:36.000Z | 2022-03-19T09:27:02.000Z | dataxHWSp2021/HW2_CoreConcepts/student/tests/q3b.py | UCBerkeley-SCET/DataX-Berkeley | f912d22c838b511d3ada4ecfa3548afd80437b74 | [
"Apache-2.0"
] | 4 | 2020-06-24T22:20:31.000Z | 2022-02-28T01:37:36.000Z | dataxHWSp2021/HW2_CoreConcepts/student/tests/q3b.py | UCBerkeley-SCET/DataX-Berkeley | f912d22c838b511d3ada4ecfa3548afd80437b74 | [
"Apache-2.0"
] | 78 | 2020-06-19T09:41:01.000Z | 2022-02-05T00:13:29.000Z | test = { 'name': 'q3b',
'points': 3,
'suites': [ { 'cases': [ { 'code': '>>> '
'print(np.mean(train_scores,axis=1).round(3))\n'
'[0.954 0.97 0.979 0.985 0.988 '
... | 54.761905 | 95 | 0.229565 |
1f69739cac447b4837daed3ea17b01ac125a4367 | 797 | py | Python | devday/talk/migrations/0042_delete_attendee_feedback_with_attendee.py | jenslauterbach/devday_website | a827c9237e656842542eff07ec9fa7b39716a0ee | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 6 | 2018-09-30T20:18:01.000Z | 2020-03-12T09:03:38.000Z | devday/talk/migrations/0042_delete_attendee_feedback_with_attendee.py | jenslauterbach/devday_website | a827c9237e656842542eff07ec9fa7b39716a0ee | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 260 | 2018-09-30T14:17:57.000Z | 2022-03-04T13:48:34.000Z | devday/talk/migrations/0042_delete_attendee_feedback_with_attendee.py | jenslauterbach/devday_website | a827c9237e656842542eff07ec9fa7b39716a0ee | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 9 | 2018-09-30T13:17:21.000Z | 2020-10-03T12:55:05.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-04-29 12:05
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
("attendee", "0009_auto_20181020_0802"),
("event", "0007... | 26.566667 | 60 | 0.588457 |
f9cdee0ce7a58c8128d3676b25266565f52c51d3 | 537 | py | Python | easyrules/support/reader/rule_definition_reader.py | wffzxyl/easyrules | 8874718fec629435c69ce360cd43a281da162627 | [
"MIT"
] | 1 | 2020-10-03T12:34:01.000Z | 2020-10-03T12:34:01.000Z | easyrules/support/reader/rule_definition_reader.py | wffzxyl/easyrules | 8874718fec629435c69ce360cd43a281da162627 | [
"MIT"
] | null | null | null | easyrules/support/reader/rule_definition_reader.py | wffzxyl/easyrules | 8874718fec629435c69ce360cd43a281da162627 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Rules engine interface.
"""
from abc import ABCMeta, abstractmethod
from typing import List
from easyrules.utils import exception_handler
class RuleDefinitionReader(metaclass=ABCMeta):
@exception_handler
@abstractmethod
def read(self, file_path: str) -> List:
"""
Read ... | 25.571429 | 96 | 0.6946 |
f6247a0962f97c4e574a50a886fbfb77814fd561 | 15,474 | py | Python | PythonNetwork/venv/Lib/site-packages/mysql/connector/django/introspection.py | Moldovandreii/RepetitionCount | b5715b0948b609fde0ce05d45023b7d4cfd635e7 | [
"FTL"
] | 1 | 2021-04-09T15:23:40.000Z | 2021-04-09T15:23:40.000Z | PythonNetwork/venv/Lib/site-packages/mysql/connector/django/introspection.py | Moldovandreii/RepetitionCount | b5715b0948b609fde0ce05d45023b7d4cfd635e7 | [
"FTL"
] | null | null | null | PythonNetwork/venv/Lib/site-packages/mysql/connector/django/introspection.py | Moldovandreii/RepetitionCount | b5715b0948b609fde0ce05d45023b7d4cfd635e7 | [
"FTL"
] | 1 | 2021-03-28T18:09:09.000Z | 2021-03-28T18:09:09.000Z | # Copyright (c) 2020, Oracle and/or its affiliates.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0, as
# published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# but no... | 43.711864 | 115 | 0.597131 |
0ccdb4b618383146e0de733c5d407498a806594a | 114 | py | Python | snake/snake/__init__.py | JoyPang123/RL-Explore-with-Own-made-Env | 4f527236571ea8a8d700d2d56c1718f2126d2d8d | [
"MIT"
] | 1 | 2021-12-07T07:37:40.000Z | 2021-12-07T07:37:40.000Z | snake/snake/__init__.py | JoyPang123/RL-Explore-with-Own-made-Env | 4f527236571ea8a8d700d2d56c1718f2126d2d8d | [
"MIT"
] | null | null | null | snake/snake/__init__.py | JoyPang123/RL-Explore-with-Own-made-Env | 4f527236571ea8a8d700d2d56c1718f2126d2d8d | [
"MIT"
] | null | null | null | from gym.envs.registration import register
register(
id='snake-v0',
entry_point='snake.envs:SnakeEnv',
)
| 16.285714 | 42 | 0.719298 |
b91e2edf9a6bf573759a03f1b8cee7f96e3e60d7 | 1,863 | py | Python | Visualization/styled_layer_descriptors.py | monocilindro/qgis-earthengine-examples | 82aea8926d34ed3f4ad4a4a345ddbd225819d28f | [
"MIT"
] | 646 | 2019-12-03T06:09:03.000Z | 2022-03-28T03:37:08.000Z | Visualization/styled_layer_descriptors.py | csaybar/qgis-earthengine-examples | ba8942683834d2847ff3246bdd1859b36e50fe44 | [
"MIT"
] | 10 | 2019-12-30T03:42:44.000Z | 2021-05-22T07:34:07.000Z | Visualization/styled_layer_descriptors.py | csaybar/qgis-earthengine-examples | ba8942683834d2847ff3246bdd1859b36e50fe44 | [
"MIT"
] | 219 | 2019-12-06T02:20:53.000Z | 2022-03-30T15:14:27.000Z | import ee
from ee_plugin import Map
cover = ee.Image('MODIS/051/MCD12Q1/2012_01_01').select('Land_Cover_Type_1')
# Define an SLD style of discrete intervals to apply to the image.
sld_intervals = \
'<RasterSymbolizer>' + \
' <ColorMap type="intervals" extended="false" >' + \
'<ColorMapEntry color="#aec3d4" quan... | 62.1 | 91 | 0.66774 |
ef5d7eb08a00d544a732b7adb80dadd78a39fbf0 | 2,954 | py | Python | Testscripts/Linux/BVT-VERIFY-UUID-FSTAB.py | senugala/LISAv2 | 42edd3e40fb0ee847bdd915343c4c064256ede4c | [
"Apache-2.0"
] | null | null | null | Testscripts/Linux/BVT-VERIFY-UUID-FSTAB.py | senugala/LISAv2 | 42edd3e40fb0ee847bdd915343c4c064256ede4c | [
"Apache-2.0"
] | null | null | null | Testscripts/Linux/BVT-VERIFY-UUID-FSTAB.py | senugala/LISAv2 | 42edd3e40fb0ee847bdd915343c4c064256ede4c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License.
from azuremodules import *
import sys
import time
import re
import linecache
def RunTest():
UpdateState("TestRunning")
uuid_from_demesg = 0
dmsg_dev_count = 0
output = JustRun("dmesg")
... | 38.363636 | 140 | 0.61239 |
69d6fdf642e999bacb659a1db08c335d0680dc96 | 437 | py | Python | experiment/util.py | tom-andersson/neuralprocesses | 7696dc1c8bbe922fb2a1ba18fe0cdda041fc9cfd | [
"MIT"
] | null | null | null | experiment/util.py | tom-andersson/neuralprocesses | 7696dc1c8bbe922fb2a1ba18fe0cdda041fc9cfd | [
"MIT"
] | null | null | null | experiment/util.py | tom-andersson/neuralprocesses | 7696dc1c8bbe922fb2a1ba18fe0cdda041fc9cfd | [
"MIT"
] | null | null | null | import lab as B
__all__ = ["with_err"]
def with_err(vals, and_lower=False, and_upper=False):
"""Print the mean value of a list of values with error."""
vals = B.to_numpy(vals)
mean = B.mean(vals)
err = 1.96 * B.std(vals) / B.sqrt(B.length(vals))
res = f"{mean:10.5f} +- {err:10.5f}"
if and_low... | 25.705882 | 62 | 0.574371 |
a855f5aed2d28386615e30726f906c83f7f34de0 | 2,745 | py | Python | sdk/python/pulumi_azure_native/domainregistration/v20180201/list_domain_recommendations.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/domainregistration/v20180201/list_domain_recommendations.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/domainregistration/v20180201/list_domain_recommendations.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 34.3125 | 170 | 0.685246 |
b47da3782c873de9cc822c18a93afdfcfdb98d0f | 40,775 | py | Python | thonny/tktextext.py | Natureshadow/thonny | 3dfc846829968ae8294b61bbdf154278850b29df | [
"MIT"
] | null | null | null | thonny/tktextext.py | Natureshadow/thonny | 3dfc846829968ae8294b61bbdf154278850b29df | [
"MIT"
] | null | null | null | thonny/tktextext.py | Natureshadow/thonny | 3dfc846829968ae8294b61bbdf154278850b29df | [
"MIT"
] | null | null | null | # coding=utf-8
"""Extensions for tk.Text"""
import platform
import time
import tkinter as tk
import traceback
from logging import exception
from tkinter import TclError, messagebox
from tkinter import font as tkfont
from tkinter import ttk
class TweakableText(tk.Text):
"""Allows intercepting Text commands at Tcl... | 36.14805 | 130 | 0.591637 |
78504e4682d31f1e857a409dd9b39c0ecdb6c924 | 7,299 | py | Python | yt/visualization/volume_rendering/transfer_function_helper.py | themousepotato/yt | 6befef2bc0427250fd62395962599be41b193e65 | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/visualization/volume_rendering/transfer_function_helper.py | themousepotato/yt | 6befef2bc0427250fd62395962599be41b193e65 | [
"BSD-3-Clause-Clear"
] | null | null | null | yt/visualization/volume_rendering/transfer_function_helper.py | themousepotato/yt | 6befef2bc0427250fd62395962599be41b193e65 | [
"BSD-3-Clause-Clear"
] | null | null | null | import matplotlib
import numpy as np
from distutils.version import LooseVersion
from yt.funcs import mylog
from yt.data_objects.profiles import create_profile
from yt.visualization.volume_rendering.transfer_functions import \
ColorTransferFunction
from io import BytesIO
class TransferFunctionHelper:
r"""A t... | 32.730942 | 90 | 0.561173 |
8462b49b868aa8141b29e19a0be853634906efa9 | 85 | py | Python | vagas/apps.py | rodgeraraujo/cv-base | c6bbd19f4586a3c4d065f486c4de6a92e26c1c9b | [
"MIT"
] | 1 | 2019-08-21T20:10:21.000Z | 2019-08-21T20:10:21.000Z | vagas/apps.py | rodgeraraujo/cv-base | c6bbd19f4586a3c4d065f486c4de6a92e26c1c9b | [
"MIT"
] | 8 | 2019-10-02T19:44:19.000Z | 2022-02-10T08:30:05.000Z | vagas/apps.py | rodgeraraujo/cv-base | c6bbd19f4586a3c4d065f486c4de6a92e26c1c9b | [
"MIT"
] | 4 | 2019-09-17T01:00:55.000Z | 2019-10-02T20:07:36.000Z | from django.apps import AppConfig
class VagasConfig(AppConfig):
name = "vagas"
| 14.166667 | 33 | 0.741176 |
27d49470797debb25f38cafee39cf075973b7b18 | 5,380 | py | Python | python/benchmarks/extensions_25percent_1teams.py | tbvanderwoude/research-project | 1c5cb09a424a0db83f18dae3278ecb7ad6866d2c | [
"Apache-2.0",
"MIT"
] | 3 | 2021-08-23T18:00:44.000Z | 2022-02-09T06:00:50.000Z | python/benchmarks/extensions_25percent_1teams.py | tbvanderwoude/research-project | 1c5cb09a424a0db83f18dae3278ecb7ad6866d2c | [
"Apache-2.0",
"MIT"
] | null | null | null | python/benchmarks/extensions_25percent_1teams.py | tbvanderwoude/research-project | 1c5cb09a424a0db83f18dae3278ecb7ad6866d2c | [
"Apache-2.0",
"MIT"
] | 1 | 2021-06-15T11:38:45.000Z | 2021-06-15T11:38:45.000Z | from multiprocessing import Pool
from typing import Optional
from mapfmclient import Problem
from tqdm import tqdm
from python.benchmarks.extensions_25percent_3teams import read_from_file
from python.benchmarks.graph_times import graph_results
from python.benchmarks.inmatch_vs_prematch_75percent_1teams import output_... | 29.081081 | 105 | 0.6171 |
df3f328e28f8bca7b4d88d903cd87578fe2ff3a2 | 578 | py | Python | code/digit_factorials/sol_34.py | bhavinjawade/project-euler-solutions | 56bf6a282730ed4b9b875fa081cf4509d9939d98 | [
"Apache-2.0"
] | 2 | 2020-07-16T08:16:32.000Z | 2020-10-01T07:16:48.000Z | code/digit_factorials/sol_34.py | Psingh12354/project-euler-solutions | 56bf6a282730ed4b9b875fa081cf4509d9939d98 | [
"Apache-2.0"
] | null | null | null | code/digit_factorials/sol_34.py | Psingh12354/project-euler-solutions | 56bf6a282730ed4b9b875fa081cf4509d9939d98 | [
"Apache-2.0"
] | 1 | 2021-05-07T18:06:08.000Z | 2021-05-07T18:06:08.000Z |
# -*- coding: utf-8 -*-
'''
File name: code\digit_factorials\sol_34.py
Author: Vaidic Joshi
Date created: Oct 20, 2018
Python Version: 3.x
'''
# Solution to Project Euler Problem #34 :: Digit factorials
#
# For more information see:
# https://projecteuler.net/problem=34
# Problem Statement
'''
145 ... | 21.407407 | 88 | 0.653979 |
aed956091a2c754e19d546901f2a83bf1ddf4038 | 1,300 | py | Python | doc/generate-doc.py | ponty/pyunpack | 09184e1f35ce8b805c672b6f7ebf06974d4ba34c | [
"BSD-2-Clause"
] | 74 | 2015-03-19T20:32:04.000Z | 2022-03-18T02:29:01.000Z | doc/generate-doc.py | ponty/pyunpack | 09184e1f35ce8b805c672b6f7ebf06974d4ba34c | [
"BSD-2-Clause"
] | 11 | 2016-01-21T11:29:21.000Z | 2022-01-24T19:26:50.000Z | doc/generate-doc.py | ponty/pyunpack | 09184e1f35ce8b805c672b6f7ebf06974d4ba34c | [
"BSD-2-Clause"
] | 9 | 2015-11-30T02:24:27.000Z | 2021-07-05T20:14:46.000Z | import glob
import logging
import os
from easyprocess import EasyProcess
from entrypoint2 import entrypoint
commands = """
python3 -m pyunpack.cli --help
"""
commands = commands.strip().splitlines()
def empty_dir(dir):
files = glob.glob(os.path.join(dir, "*"))
for f in files:
os.remove(f)
@entry... | 25 | 76 | 0.555385 |
6fdc7319b512cca35163df8683c7cbb1bab4957f | 1,215 | py | Python | Walker.py | ey3lock3r/The-Nature-of-Code | cca3a0359a46570b1cf0b02315be8cee1728a01a | [
"MIT"
] | null | null | null | Walker.py | ey3lock3r/The-Nature-of-Code | cca3a0359a46570b1cf0b02315be8cee1728a01a | [
"MIT"
] | null | null | null | Walker.py | ey3lock3r/The-Nature-of-Code | cca3a0359a46570b1cf0b02315be8cee1728a01a | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import matplotlib.animation as animation
import numpy as np
import noise
map = lambda n, start1, stop1, start2, stop2: ((n-start1)/(stop1-start1))*(stop2-start2)+start2
class Walker():
def __init__(self):
self.fig, self.ax = plt.subplots(figsize=(8, 5), subplot_kw=... | 31.973684 | 124 | 0.561317 |
bf540c2d9004cbfba99d2117e9e8bfc7eed95f5c | 75 | py | Python | instance/config.py | cherucole/News.io | 6a00132acf37b39649d2954d43433a2eb4a414ac | [
"Unlicense",
"MIT"
] | null | null | null | instance/config.py | cherucole/News.io | 6a00132acf37b39649d2954d43433a2eb4a414ac | [
"Unlicense",
"MIT"
] | null | null | null | instance/config.py | cherucole/News.io | 6a00132acf37b39649d2954d43433a2eb4a414ac | [
"Unlicense",
"MIT"
] | null | null | null | NEWS_API_KEY='34c58192d7aa4ba89c5f8fcca69719a8'
SECRET_KEY = 'mySecretKey'
| 25 | 47 | 0.866667 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.