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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c18e75b4c0d8655ec592e5168239465e8239fa7 | 1,308 | py | Python | lucid/optvis/param/images.py | girving/lucid | 19f171cd73f763f3143b74f7d886bcb499d0e058 | [
"Apache-2.0"
] | 7 | 2018-11-06T20:49:27.000Z | 2022-02-12T15:24:00.000Z | lucid/optvis/param/images.py | girving/lucid | 19f171cd73f763f3143b74f7d886bcb499d0e058 | [
"Apache-2.0"
] | 2 | 2020-07-19T11:08:01.000Z | 2022-01-22T10:29:30.000Z | lucid/optvis/param/images.py | girving/lucid | 19f171cd73f763f3143b74f7d886bcb499d0e058 | [
"Apache-2.0"
] | 3 | 2019-04-02T15:57:30.000Z | 2019-10-23T22:32:06.000Z |
# Copyright 2018 The Lucid 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 ... | 34.421053 | 83 | 0.681193 |
import numpy as np
import tensorflow as tf
from lucid.optvis.param.color import to_valid_rgb
from lucid.optvis.param.spatial import naive, fft_image
def image(w, h=None, batch=None, sd=None, decorrelate=True, fft=True, alpha=False):
h = h or w
batch = batch or 1
channels = 4 if alpha else 3
shape = [batch... | true | true |
1c18e7dd68bc7a91f4d6f776ff285a19a44d53ab | 14,100 | py | Python | connect/cli/plugins/project/extension/validations.py | cloudblue/product-sync | 0e1754967830b19673c1625b82ae1535658ec3bc | [
"Apache-2.0"
] | null | null | null | connect/cli/plugins/project/extension/validations.py | cloudblue/product-sync | 0e1754967830b19673c1625b82ae1535658ec3bc | [
"Apache-2.0"
] | null | null | null | connect/cli/plugins/project/extension/validations.py | cloudblue/product-sync | 0e1754967830b19673c1625b82ae1535658ec3bc | [
"Apache-2.0"
] | null | null | null | import dataclasses
import importlib
import inspect
import os
import re
import sys
from typing import List, Literal, Optional
import toml
import yaml
from connect.cli.plugins.project.extension.utils import get_event_definitions, get_pypi_runner_version
from connect.eaas.core.extension import Extension
from connect.eaa... | 34.474328 | 117 | 0.567943 | import dataclasses
import importlib
import inspect
import os
import re
import sys
from typing import List, Literal, Optional
import toml
import yaml
from connect.cli.plugins.project.extension.utils import get_event_definitions, get_pypi_runner_version
from connect.eaas.core.extension import Extension
from connect.eaa... | true | true |
1c18e89465027924c8c964c4b4930e4e7078c5ae | 18,773 | py | Python | main.py | Wanjpeng/nvrjevnkbklremvklmkekrbemk | ab0ef61a04a7a46021fd546a6112b11780849d82 | [
"Apache-2.0"
] | 1 | 2020-03-01T07:13:00.000Z | 2020-03-01T07:13:00.000Z | main.py | Wanjpeng/nvrjevnkbklremvklmkekrbemk | ab0ef61a04a7a46021fd546a6112b11780849d82 | [
"Apache-2.0"
] | null | null | null | main.py | Wanjpeng/nvrjevnkbklremvklmkekrbemk | ab0ef61a04a7a46021fd546a6112b11780849d82 | [
"Apache-2.0"
] | null | null | null | import time
#from multiprocessing import Pool
#from multiprocessing import freeze_support
from threading import Thread
import numpy as np
import random
import win32gui, win32con
CONFIGFILE = '.\lwp.conf'
class DriftWords:
def __init__(self):
self.Words = []
self.Coors = []
self... | 45.899756 | 164 | 0.552336 | import time
from threading import Thread
import numpy as np
import random
import win32gui, win32con
CONFIGFILE = '.\lwp.conf'
class DriftWords:
def __init__(self):
self.Words = []
self.Coors = []
self.Velocities = []
self.Accelerations = []
self.__XMINC = 0
... | true | true |
1c18e89f00b70aefc6f9b03f93f68ef67226e7d2 | 5,046 | py | Python | bot/venv/lib/python3.7/site-packages/pyglet/window/cocoa/pyglet_window.py | manaccac/sc2_bot | 3aa8b3711378b71fd0a44662cdd7148846e39530 | [
"MIT"
] | 2 | 2021-05-16T07:39:38.000Z | 2021-05-30T22:04:42.000Z | bot/venv/lib/python3.7/site-packages/pyglet/window/cocoa/pyglet_window.py | manaccac/sc2_bot | 3aa8b3711378b71fd0a44662cdd7148846e39530 | [
"MIT"
] | null | null | null | bot/venv/lib/python3.7/site-packages/pyglet/window/cocoa/pyglet_window.py | manaccac/sc2_bot | 3aa8b3711378b71fd0a44662cdd7148846e39530 | [
"MIT"
] | 2 | 2020-10-21T15:34:59.000Z | 2020-11-19T15:23:55.000Z | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# Copyright (c) 2008-2020 pyglet contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the follo... | 44.654867 | 104 | 0.688862 |
from ctypes import c_void_p, c_bool
from pyglet.libs.darwin.cocoapy import ObjCClass, ObjCSubclass, send_super
from pyglet.libs.darwin.cocoapy import NSUInteger, NSUIntegerEncoding
from pyglet.libs.darwin.cocoapy import NSRectEncoding
class PygletWindow_Implementation:
PygletWindow = ObjCSubclass('NSWindow', 'P... | true | true |
1c18e9fe0639fac639a1ec3c4de69484bb232851 | 3,923 | py | Python | tests/valgrind/supp-generalize.py | swipswaps/tarsnap-gui | 53b51a33a8774c92047285bf3be244333f57e57b | [
"BSD-2-Clause"
] | null | null | null | tests/valgrind/supp-generalize.py | swipswaps/tarsnap-gui | 53b51a33a8774c92047285bf3be244333f57e57b | [
"BSD-2-Clause"
] | null | null | null | tests/valgrind/supp-generalize.py | swipswaps/tarsnap-gui | 53b51a33a8774c92047285bf3be244333f57e57b | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
import sys
DEBUG = False
def process_chunk(chunk_pre):
lines = chunk_pre.split("\n")
# If the chunk is only a # line, bail
if lines[0].startswith("# "):
return chunk_pre
# Strip { and } from the beginning / end
if lines[0] == "{" and lines[-2] == "}" and lines[-1]... | 28.635036 | 76 | 0.60311 |
import sys
DEBUG = False
def process_chunk(chunk_pre):
lines = chunk_pre.split("\n")
if lines[0].startswith("# "):
return chunk_pre
if lines[0] == "{" and lines[-2] == "}" and lines[-1] == "":
lines = lines[1:-2]
else:
raise Exception("Unexpected chunk beginning / en... | true | true |
1c18eaf94e45b2c7e602caca9adfcad3ad3602c0 | 94 | py | Python | tutor_group_system/tutor_group_system/__init__.py | alejarcialopez/tutor-group-system | 14da31fc4d5c84bfaef03fb9ac3136eaa504e65e | [
"MIT"
] | null | null | null | tutor_group_system/tutor_group_system/__init__.py | alejarcialopez/tutor-group-system | 14da31fc4d5c84bfaef03fb9ac3136eaa504e65e | [
"MIT"
] | null | null | null | tutor_group_system/tutor_group_system/__init__.py | alejarcialopez/tutor-group-system | 14da31fc4d5c84bfaef03fb9ac3136eaa504e65e | [
"MIT"
] | null | null | null | """
tutor-group-system Application
"""
default_app_config = 'tutor_group_system.apps.Config'
| 15.666667 | 53 | 0.776596 | default_app_config = 'tutor_group_system.apps.Config'
| true | true |
1c18eb7718a85bb8426c9954a82d8f5c699ee0b6 | 473 | py | Python | api/migrations/0032_auto_20180517_0028.py | pokotsun/kyutechAppServer2018 | 9fe579c63e59ee585137e89d11c9cdccd58d3186 | [
"MIT"
] | 4 | 2018-08-09T15:19:06.000Z | 2021-04-03T12:24:57.000Z | api/migrations/0032_auto_20180517_0028.py | pokotsun/kyutechAppServer2018 | 9fe579c63e59ee585137e89d11c9cdccd58d3186 | [
"MIT"
] | 2 | 2018-10-19T15:32:17.000Z | 2020-06-05T19:41:14.000Z | api/migrations/0032_auto_20180517_0028.py | pokotsun/kyutechAppServer2018 | 9fe579c63e59ee585137e89d11c9cdccd58d3186 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.4 on 2018-05-16 15:28
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('api', '0031_auto_20180516_1603'),
]
operations = [
migrations.AlterField(
model_name='usersched... | 23.65 | 100 | 0.640592 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('api', '0031_auto_20180516_1603'),
]
operations = [
migrations.AlterField(
model_name='userschedule',
name='syllabus',
f... | true | true |
1c18ec2e4590ed4b0e10a336b9d56f6ee5dcef5c | 871 | py | Python | src/kgmk/dsa/tree/heap/binary/__init__.py | kagemeka/python | 486ce39d97360b61029527bacf00a87fdbcf552c | [
"MIT"
] | null | null | null | src/kgmk/dsa/tree/heap/binary/__init__.py | kagemeka/python | 486ce39d97360b61029527bacf00a87fdbcf552c | [
"MIT"
] | null | null | null | src/kgmk/dsa/tree/heap/binary/__init__.py | kagemeka/python | 486ce39d97360b61029527bacf00a87fdbcf552c | [
"MIT"
] | null | null | null | import typing
import heapq
@typing.final
class BinaryHeap():
def __init__(
self,
) -> typing.NoReturn:
self.__a = []
def __swap(
self,
i: int,
j: int,
) -> typing.NoReturn:
a = self.__a
a[i], a[j] = a[j], a[i]
def push(
self,
x: int,
) -> typing.NoReturn:
a = s... | 15.017241 | 45 | 0.46039 | import typing
import heapq
@typing.final
class BinaryHeap():
def __init__(
self,
) -> typing.NoReturn:
self.__a = []
def __swap(
self,
i: int,
j: int,
) -> typing.NoReturn:
a = self.__a
a[i], a[j] = a[j], a[i]
def push(
self,
x: int,
) -> typing.NoReturn:
a = s... | true | true |
1c18ec6128a5272abe92bb15c5e0505507f7c1b6 | 3,357 | py | Python | azure-keyvault/azure/keyvault/v7_0/models/deleted_storage_bundle.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-keyvault/azure/keyvault/v7_0/models/deleted_storage_bundle.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-keyvault/azure/keyvault/v7_0/models/deleted_storage_bundle.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 43.038462 | 83 | 0.641346 |
from .storage_bundle import StorageBundle
class DeletedStorageBundle(StorageBundle):
_validation = {
'id': {'readonly': True},
'resource_id': {'readonly': True},
'active_key_name': {'readonly': True},
'auto_regenerate_key': {'readonly': True},
'regeneration_period': {'rea... | true | true |
1c18ec8c2c287afba860bc841a88a4cf9a801d68 | 1,096 | py | Python | 0x06-python-classes/4-square.py | Dev-Loup/holbertonschool-higher_level_programming | af6fe9a05c87dcdbb88270eec4c7ec81d6a70d9b | [
"FSFAP"
] | null | null | null | 0x06-python-classes/4-square.py | Dev-Loup/holbertonschool-higher_level_programming | af6fe9a05c87dcdbb88270eec4c7ec81d6a70d9b | [
"FSFAP"
] | null | null | null | 0x06-python-classes/4-square.py | Dev-Loup/holbertonschool-higher_level_programming | af6fe9a05c87dcdbb88270eec4c7ec81d6a70d9b | [
"FSFAP"
] | null | null | null | #!/usr/bin/python3
""" Class Square creation module
A Blueprint for squares
"""
class Square:
"""Set the class square"""
def __init__(self, size=0):
"""Iniatiate Attributes for Square class.
Args:
size: integer with size of the square.
"""
self.__size = size
... | 21.490196 | 54 | 0.521898 |
class Square:
def __init__(self, size=0):
self.__size = size
@property
def size(self):
return self.__size
@size.setter
def size(self, value):
if type(value) is int:
if value < 0:
raise ValueError("size must be >= 0")
self.__size... | true | true |
1c18ed66959ab41c4fafbcd1adc7d6fdc44c6b3e | 129 | py | Python | libpythonpro/spam/modelos.py | GilmarDeJesusSantana/libopythonpro | 2e69614a6a7f67130bf03a994aa3e2cb2f68dd10 | [
"MIT"
] | null | null | null | libpythonpro/spam/modelos.py | GilmarDeJesusSantana/libopythonpro | 2e69614a6a7f67130bf03a994aa3e2cb2f68dd10 | [
"MIT"
] | 148 | 2019-12-11T10:25:52.000Z | 2022-02-11T20:50:56.000Z | libpythonpro/spam/modelos.py | GilmarDeJesusSantana/libopythonpro | 2e69614a6a7f67130bf03a994aa3e2cb2f68dd10 | [
"MIT"
] | null | null | null |
class Usuario:
def __init__(self, nome, email):
self.email = email
self.nome = nome
self.id = None
| 16.125 | 36 | 0.55814 |
class Usuario:
def __init__(self, nome, email):
self.email = email
self.nome = nome
self.id = None
| true | true |
1c18edc12b195cf5754c588f81a0aaf4650a35ed | 1,866 | py | Python | tests/testsuite_recording/integration/test_api.py | Hojang2/packit | 8396278d16ddf84d55bc7c31d9bf9d799d35c24b | [
"MIT"
] | null | null | null | tests/testsuite_recording/integration/test_api.py | Hojang2/packit | 8396278d16ddf84d55bc7c31d9bf9d799d35c24b | [
"MIT"
] | null | null | null | tests/testsuite_recording/integration/test_api.py | Hojang2/packit | 8396278d16ddf84d55bc7c31d9bf9d799d35c24b | [
"MIT"
] | null | null | null | import os
import git
from packit.api import PackitAPI
from subprocess import check_output
from flexmock import flexmock
from tests.testsuite_recording.integration.testbase import PackitUnittestOgr
class ProposeUpdate(PackitUnittestOgr):
def setUp(self):
super().setUp()
self.api = PackitAPI(
... | 38.875 | 85 | 0.627546 | import os
import git
from packit.api import PackitAPI
from subprocess import check_output
from flexmock import flexmock
from tests.testsuite_recording.integration.testbase import PackitUnittestOgr
class ProposeUpdate(PackitUnittestOgr):
def setUp(self):
super().setUp()
self.api = PackitAPI(
... | true | true |
1c18ee44cf80ca2d9c331cf1d916326a27cec974 | 13,057 | py | Python | src/packages/galaxy/galaxy.py | mbravorus/pipsqueak3 | a45154c5459f0995669cf46c56a6b3fc8e958e01 | [
"BSD-3-Clause"
] | null | null | null | src/packages/galaxy/galaxy.py | mbravorus/pipsqueak3 | a45154c5459f0995669cf46c56a6b3fc8e958e01 | [
"BSD-3-Clause"
] | null | null | null | src/packages/galaxy/galaxy.py | mbravorus/pipsqueak3 | a45154c5459f0995669cf46c56a6b3fc8e958e01 | [
"BSD-3-Clause"
] | null | null | null | """
galaxy.py - Provide functions to interact with and retrieve useful information from the
Fuel Rats Systems API.
Copyright (c) 2018 The Fuel Rat Mischief,
All rights reserved.
Licensed under the BSD 3-Clause License.
See LICENSE.md
"""
import asyncio
import json
import typing
from html import escape
... | 38.976119 | 103 | 0.564372 |
import asyncio
import json
import typing
from html import escape
import aiohttp
from src.config import CONFIG_MARKER
from .star_system import StarSystem
from ..utils import Vector
class Galaxy:
_config: typing.ClassVar[typing.Dict]
@classmethod
@CONFIG_MARKER
def rehash_handler(cls, data: typing.D... | true | true |
1c18ee7fdc3c1c4ced580c48554ae9e9f453930b | 1,088 | py | Python | src/dataclass.py | ironWolf1990/github-traffic | 1f99ba284e50679fe4d385aafe976be742278298 | [
"MIT"
] | 3 | 2021-04-26T22:51:43.000Z | 2021-04-26T22:51:57.000Z | src/dataclass.py | ironWolf1990/github-traffic | 1f99ba284e50679fe4d385aafe976be742278298 | [
"MIT"
] | null | null | null | src/dataclass.py | ironWolf1990/github-traffic | 1f99ba284e50679fe4d385aafe976be742278298 | [
"MIT"
] | 1 | 2021-04-26T13:50:13.000Z | 2021-04-26T13:50:13.000Z | from typing import List, NamedTuple, Tuple
ntReferral = NamedTuple(
"ntReferral",
[
("referrer", str),
("count", int),
("uniques", int),
],
)
ntPath = NamedTuple(
"ntPath",
[
("path", str),
("title", str),
("count", int),
("uniques", int),
... | 16.238806 | 42 | 0.448529 | from typing import List, NamedTuple, Tuple
ntReferral = NamedTuple(
"ntReferral",
[
("referrer", str),
("count", int),
("uniques", int),
],
)
ntPath = NamedTuple(
"ntPath",
[
("path", str),
("title", str),
("count", int),
("uniques", int),
... | true | true |
1c18eec593939d689b35b1cbda89c5b9ca9b47a7 | 553 | py | Python | LicenseGenerator/CustomerInformation/templatetags/form_tags.py | psnipiv/LicenseGenerator | ba4d059f88bb647d3a134af757f914a290a5786c | [
"BSD-2-Clause"
] | null | null | null | LicenseGenerator/CustomerInformation/templatetags/form_tags.py | psnipiv/LicenseGenerator | ba4d059f88bb647d3a134af757f914a290a5786c | [
"BSD-2-Clause"
] | null | null | null | LicenseGenerator/CustomerInformation/templatetags/form_tags.py | psnipiv/LicenseGenerator | ba4d059f88bb647d3a134af757f914a290a5786c | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jan 8 23:38:12 2018
@author: pilla
"""
from django import template
register = template.Library()
@register.filter
def field_type(bound_field):
return bound_field.field.widget.__class__.__name__
@register.filter
def input_class(bound_field):
css_class = ''
if b... | 23.041667 | 56 | 0.674503 | from django import template
register = template.Library()
@register.filter
def field_type(bound_field):
return bound_field.field.widget.__class__.__name__
@register.filter
def input_class(bound_field):
css_class = ''
if bound_field.form.is_bound:
if bound_field.errors:
css_class = 'is... | true | true |
1c18eeecb9d4d1d1186d18321d839674d7aa8768 | 1,840 | py | Python | octavia-cli/octavia_cli/apply/diff_helpers.py | Danucas/airbyte | 9e77879a7a3b1a5a559a3df9fa85056365b6fbef | [
"MIT"
] | 1 | 2022-03-29T01:08:58.000Z | 2022-03-29T01:08:58.000Z | octavia-cli/octavia_cli/apply/diff_helpers.py | Danucas/airbyte | 9e77879a7a3b1a5a559a3df9fa85056365b6fbef | [
"MIT"
] | 5 | 2022-02-22T14:49:48.000Z | 2022-03-19T10:43:08.000Z | octavia-cli/octavia_cli/apply/diff_helpers.py | Danucas/airbyte | 9e77879a7a3b1a5a559a3df9fa85056365b6fbef | [
"MIT"
] | 1 | 2022-03-11T06:21:24.000Z | 2022-03-11T06:21:24.000Z | #
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
import hashlib
import json
from typing import Any
import click
from deepdiff import DeepDiff
SECRET_MASK = "**********"
def hash_config(configuration: dict) -> str:
"""Computes a SHA256 hash from a dictionnary.
Args:
configuration (dict)... | 24.210526 | 86 | 0.627717 |
import hashlib
import json
from typing import Any
import click
from deepdiff import DeepDiff
SECRET_MASK = "**********"
def hash_config(configuration: dict) -> str:
stringified = json.dumps(configuration, sort_keys=True)
return hashlib.sha256(stringified.encode("utf-8")).hexdigest()
def exclude_secrets_f... | true | true |
1c18eef1b66dfe24066a2a28229e11bc9ad6ffad | 5,759 | py | Python | events/models.py | sahilkalra1991/MeetnEat | 306782d2840cb76b8ddb467e18d84b7c852c31f6 | [
"Apache-2.0"
] | null | null | null | events/models.py | sahilkalra1991/MeetnEat | 306782d2840cb76b8ddb467e18d84b7c852c31f6 | [
"Apache-2.0"
] | null | null | null | events/models.py | sahilkalra1991/MeetnEat | 306782d2840cb76b8ddb467e18d84b7c852c31f6 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from datetime import datetime
class Campus(models.Model):
"""
A campus will represent a university campus e.g. TUM Main Campus, TUM Garching campus
"""
name = models.CharField(max_length=100)
description = models.TextField(blank=True)
created_at = models.DateTimeFi... | 40.843972 | 120 | 0.715055 | from django.db import models
from datetime import datetime
class Campus(models.Model):
name = models.CharField(max_length=100)
description = models.TextField(blank=True)
created_at = models.DateTimeField(default=datetime.now)
modified_at = models.DateTimeField(auto_now=True)
class Meta:
v... | true | true |
1c18ef891b8c596afd237a304d433d9f3e6ba47b | 31,718 | py | Python | pandas/core/groupby/ops.py | treuherz/pandas | a313f7ff5c003bc14fa36714d41c9842209b4e6a | [
"BSD-3-Clause"
] | 1 | 2020-08-18T16:49:16.000Z | 2020-08-18T16:49:16.000Z | pandas/core/groupby/ops.py | treuherz/pandas | a313f7ff5c003bc14fa36714d41c9842209b4e6a | [
"BSD-3-Clause"
] | null | null | null | pandas/core/groupby/ops.py | treuherz/pandas | a313f7ff5c003bc14fa36714d41c9842209b4e6a | [
"BSD-3-Clause"
] | null | null | null | """
Provide classes to perform the groupby aggregate operations.
These are not exposed to the user and provide implementations of the grouping
operations, primarily in cython. These classes (BaseGrouper and BinGrouper)
are contained *in* the SeriesGroupBy and DataFrameGroupBy objects.
"""
import collections
from typi... | 33.706695 | 88 | 0.601488 |
import collections
from typing import Dict, Generic, Hashable, List, Optional, Sequence, Tuple, Type
import numpy as np
from pandas._libs import NaT, iNaT, lib
import pandas._libs.groupby as libgroupby
import pandas._libs.reduction as libreduction
from pandas._typing import F, FrameOrSeries, Label
from pandas.errors... | true | true |
1c18ef8f6b675b57659b7200e44470356960bf5e | 70 | py | Python | References/Geovana Neves/TCC_Geovana_Neves_GitHub/SUAVE_modifications/SUAVE-feature-constant_throttle_EAS/trunk/SUAVE/Attributes/Atmospheres/__init__.py | Vinicius-Tanigawa/Undergraduate-Research-Project | e92372f07882484b127d7affe305eeec2238b8a9 | [
"MIT"
] | null | null | null | References/Geovana Neves/TCC_Geovana_Neves_GitHub/SUAVE_modifications/SUAVE-feature-constant_throttle_EAS/trunk/SUAVE/Attributes/Atmospheres/__init__.py | Vinicius-Tanigawa/Undergraduate-Research-Project | e92372f07882484b127d7affe305eeec2238b8a9 | [
"MIT"
] | null | null | null | References/Geovana Neves/TCC_Geovana_Neves_GitHub/SUAVE_modifications/SUAVE-feature-constant_throttle_EAS/trunk/SUAVE/Attributes/Atmospheres/__init__.py | Vinicius-Tanigawa/Undergraduate-Research-Project | e92372f07882484b127d7affe305eeec2238b8a9 | [
"MIT"
] | null | null | null |
# classes
from Atmosphere import Atmosphere
# packages
import Earth
| 10 | 33 | 0.8 |
from Atmosphere import Atmosphere
import Earth
| true | true |
1c18efd93b00e0a0baa91e621366f620e91a22d6 | 683 | py | Python | app/core/migrations/0002_tag.py | Ruiponche/recipe-app-api | 031bbd2c556dc6c9a6b877c76cd25ef00bc3eb14 | [
"MIT"
] | null | null | null | app/core/migrations/0002_tag.py | Ruiponche/recipe-app-api | 031bbd2c556dc6c9a6b877c76cd25ef00bc3eb14 | [
"MIT"
] | null | null | null | app/core/migrations/0002_tag.py | Ruiponche/recipe-app-api | 031bbd2c556dc6c9a6b877c76cd25ef00bc3eb14 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2021-01-03 23:02
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 28.458333 | 118 | 0.616398 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Tag',
fields=[
... | true | true |
1c18f04c269c85c105f8e3ae7f6531b972779994 | 982 | py | Python | futhark_ffi/build.py | cclauss/futhark-pycffi | 99af752fea6f63ea07276000b39434cc37dfd3ce | [
"MIT"
] | null | null | null | futhark_ffi/build.py | cclauss/futhark-pycffi | 99af752fea6f63ea07276000b39434cc37dfd3ce | [
"MIT"
] | null | null | null | futhark_ffi/build.py | cclauss/futhark-pycffi | 99af752fea6f63ea07276000b39434cc37dfd3ce | [
"MIT"
] | null | null | null | import re
import sys
from cffi import FFI
def strip_includes(header):
return re.sub('^(#ifdef __cplusplus\n.*\n#endif|#.*)\n', '', header, flags=re.M)
def build(name):
ffibuilder = FFI()
with open(name+'.c') as source:
if sys.platform == 'darwin':
libraries=['m']
extra_com... | 28.057143 | 84 | 0.559063 | import re
import sys
from cffi import FFI
def strip_includes(header):
return re.sub('^(#ifdef __cplusplus\n.*\n#endif|#.*)\n', '', header, flags=re.M)
def build(name):
ffibuilder = FFI()
with open(name+'.c') as source:
if sys.platform == 'darwin':
libraries=['m']
extra_com... | true | true |
1c18f0e3180251b7fcd5afa6b83d4894be4e0cfe | 4,915 | py | Python | kubernetes/client/models/v1_container_state.py | lp67/python | 33c5ea9835356410ce4a9fa54a02c6a2a22143c6 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_container_state.py | lp67/python | 33c5ea9835356410ce4a9fa54a02c6a2a22143c6 | [
"Apache-2.0"
] | 4 | 2019-11-19T10:33:47.000Z | 2022-03-01T03:33:52.000Z | kubernetes/client/models/v1_container_state.py | mohramadan911/PythonClientAPI | 5d111812c81b7a573ac8661d1aec60bb97072412 | [
"Apache-2.0"
] | 2 | 2021-08-10T16:35:31.000Z | 2021-09-14T04:53:06.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.20
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | 28.410405 | 124 | 0.598983 |
import pprint
import re
import six
from kubernetes.client.configuration import Configuration
class V1ContainerState(object):
openapi_types = {
'running': 'V1ContainerStateRunning',
'terminated': 'V1ContainerStateTerminated',
'waiting': 'V1ContainerStateWaiting'
}
attribute_... | true | true |
1c18f119d122ad8621bd869cabb6531cb994016c | 13,203 | py | Python | pypy/module/cpyext/stringobject.py | pypyjs/pypy | 2c2c5c73d780ff71f03adc2f1bf2c1c4bb7cc031 | [
"Apache-2.0",
"OpenSSL"
] | 34 | 2015-07-09T04:53:27.000Z | 2021-07-19T05:22:27.000Z | pypy/module/cpyext/stringobject.py | reingart/pypy | 9d6b4fb5eaabe6d2bbe63e063709d72d86f8b153 | [
"Apache-2.0",
"OpenSSL"
] | 6 | 2015-05-30T17:20:45.000Z | 2017-06-12T14:29:23.000Z | pypy/module/cpyext/stringobject.py | pypyjs/pypy | 2c2c5c73d780ff71f03adc2f1bf2c1c4bb7cc031 | [
"Apache-2.0",
"OpenSSL"
] | 11 | 2015-09-07T14:26:08.000Z | 2020-04-10T07:20:41.000Z | from pypy.interpreter.error import OperationError
from rpython.rtyper.lltypesystem import rffi, lltype
from pypy.module.cpyext.api import (
cpython_api, cpython_struct, bootstrap_function, build_type_checkers,
PyObjectFields, Py_ssize_t, CONST_STRING, CANNOT_FAIL)
from pypy.module.cpyext.pyerrors import PyErr_B... | 41.259375 | 91 | 0.708703 | from pypy.interpreter.error import OperationError
from rpython.rtyper.lltypesystem import rffi, lltype
from pypy.module.cpyext.api import (
cpython_api, cpython_struct, bootstrap_function, build_type_checkers,
PyObjectFields, Py_ssize_t, CONST_STRING, CANNOT_FAIL)
from pypy.module.cpyext.pyerrors import PyErr_B... | true | true |
1c18f1ff2ac1cdb0631dbc59f29b154415339cd9 | 4,467 | py | Python | .venv/lib/python3.8/site-packages/dill/pointers.py | eo1989/VectorBTanalysis | bea3deaf2ee3fc114b308146f2af3e4f35f70197 | [
"MIT"
] | 21 | 2021-01-10T16:44:55.000Z | 2022-03-03T13:15:07.000Z | .venv/lib/python3.8/site-packages/dill/pointers.py | eo1989/VectorBTanalysis | bea3deaf2ee3fc114b308146f2af3e4f35f70197 | [
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | Lib/site-packages/dill/pointers.py | fochoao/cpython | 3dc84b260e5bced65ebc2c45c40c8fa65f9b5aa9 | [
"bzip2-1.0.6",
"0BSD"
] | 11 | 2020-06-29T08:40:24.000Z | 2022-02-24T17:39:16.000Z | #!/usr/bin/env python
#
# Author: Mike McKerns (mmckerns @caltech and @uqfoundation)
# Copyright (c) 2008-2016 California Institute of Technology.
# Copyright (c) 2016-2020 The Uncertainty Quantification Foundation.
# License: 3-clause BSD. The full license text is available at:
# - https://github.com/uqfoundation/di... | 36.317073 | 76 | 0.65122 |
__all__ = ['parent', 'reference', 'at', 'parents', 'children']
import gc
import sys
from ._dill import _proxy_helper as reference
from ._dill import _locate_object as at
def parent(obj, objtype, ignore=()):
depth = 1 chain = parents(obj, objtype, depth, ignore)
parent = chain.pop()
if parent is obj:... | true | true |
1c18f2d4794a5e227cd93330d947fa2597d484d0 | 20,873 | py | Python | examples/multi-layer/plane_wave/setplot.py | dlgeorge/geoclaw | 2b4ce9b1ba2532fe3ac38ee7c05297eb61e45bd1 | [
"BSD-3-Clause"
] | null | null | null | examples/multi-layer/plane_wave/setplot.py | dlgeorge/geoclaw | 2b4ce9b1ba2532fe3ac38ee7c05297eb61e45bd1 | [
"BSD-3-Clause"
] | 1 | 2018-07-28T00:20:55.000Z | 2018-07-28T01:13:43.000Z | examples/multi-layer/plane_wave/setplot.py | dsrim/geoclaw | 3fa4dcea359e6439d1fbb79f0d478e65ff2ea38f | [
"BSD-3-Clause"
] | null | null | null |
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
"""
from __future__ import absolute_import
from __future__ import print_function
import os
import numpy as np
import matplotl... | 36.491259 | 109 | 0.610885 |
from __future__ import absolute_import
from __future__ import print_function
import os
import numpy as np
import matplotlib.pyplot as plt
from clawpack.visclaw import geoplot, gaugetools
import clawpack.clawutil.data as clawutil
import clawpack.amrclaw.data as amrclaw
import clawpack.geoclaw.data
import clawpack... | true | true |
1c18f3131c028db18c1a907dc2b219d7af8e7d70 | 676 | py | Python | challenge_4/python/CindyB/src/TreeNode.py | rchicoli/2017-challenges | 44f0b672e5dea34de1dde131b6df837d462f8e29 | [
"Apache-2.0"
] | 271 | 2017-01-01T22:58:36.000Z | 2021-11-28T23:05:29.000Z | challenge_4/python/CindyB/src/TreeNode.py | AakashOfficial/2017Challenges | a8f556f1d5b43c099a0394384c8bc2d826f9d287 | [
"Apache-2.0"
] | 283 | 2017-01-01T23:26:05.000Z | 2018-03-23T00:48:55.000Z | challenge_4/python/CindyB/src/TreeNode.py | AakashOfficial/2017Challenges | a8f556f1d5b43c099a0394384c8bc2d826f9d287 | [
"Apache-2.0"
] | 311 | 2017-01-01T22:59:23.000Z | 2021-09-23T00:29:12.000Z | class TreeNode:
def __init__(self,value):
self._value = value
self._right_child = None
self._left_child = None
def print_node(self):
if self._left_child != None:
self._left_child.print_node()
print str(self._value),
if self._right_child != No... | 30.727273 | 44 | 0.606509 | class TreeNode:
def __init__(self,value):
self._value = value
self._right_child = None
self._left_child = None
def print_node(self):
if self._left_child != None:
self._left_child.print_node()
print str(self._value),
if self._right_child != No... | false | true |
1c18f357402f671bcf6e31be04a7a6efb938050d | 827 | py | Python | src/astro/files/types/csv.py | astro-projects/astro | 7fa0404fc690569ff85e379ecca54778f09a9333 | [
"Apache-2.0"
] | 71 | 2021-12-06T22:41:59.000Z | 2022-03-31T21:47:16.000Z | src/astro/files/types/csv.py | astro-projects/astro | 7fa0404fc690569ff85e379ecca54778f09a9333 | [
"Apache-2.0"
] | 171 | 2021-12-14T07:34:57.000Z | 2022-03-31T21:04:15.000Z | src/astro/files/types/csv.py | astro-projects/astro | 7fa0404fc690569ff85e379ecca54778f09a9333 | [
"Apache-2.0"
] | 11 | 2021-12-06T22:46:23.000Z | 2022-03-31T18:09:46.000Z | import io
import pandas as pd
from astro.constants import FileType as FileTypeConstants
from astro.files.types.base import FileType
class CSVFileType(FileType):
"""Concrete implementation to handle CSV file type"""
def export_to_dataframe(self, stream, **kwargs) -> pd.DataFrame:
"""read csv file fr... | 27.566667 | 88 | 0.681983 | import io
import pandas as pd
from astro.constants import FileType as FileTypeConstants
from astro.files.types.base import FileType
class CSVFileType(FileType):
def export_to_dataframe(self, stream, **kwargs) -> pd.DataFrame:
return pd.read_csv(stream, **kwargs)
def create_from_dataframe(self, df:... | true | true |
1c18f35f97b89d6dcdbf7b849746dc5eb423a55b | 594 | py | Python | Apostila_Bimestre_II/da_Apostila/calculadora.py | viniciusm0raes/python | c4d4f1a08d1e4de105109e1f67fae9fcc20d7fce | [
"MIT"
] | null | null | null | Apostila_Bimestre_II/da_Apostila/calculadora.py | viniciusm0raes/python | c4d4f1a08d1e4de105109e1f67fae9fcc20d7fce | [
"MIT"
] | null | null | null | Apostila_Bimestre_II/da_Apostila/calculadora.py | viniciusm0raes/python | c4d4f1a08d1e4de105109e1f67fae9fcc20d7fce | [
"MIT"
] | null | null | null | print("Bem vindo à Calculadora.")
num1 = eval(input("Informe um número: "))
num2 = eval(input("Informe outro número: "))
op = input("Informe a operação:\n + para Adição\n - para Subtração\n * para multiplicação\n / para divisão: ")
if op == '+':
print("A soma de ", num1, "e", num2, " é: ", num1 + num2)
elif op == ... | 39.6 | 110 | 0.609428 | print("Bem vindo à Calculadora.")
num1 = eval(input("Informe um número: "))
num2 = eval(input("Informe outro número: "))
op = input("Informe a operação:\n + para Adição\n - para Subtração\n * para multiplicação\n / para divisão: ")
if op == '+':
print("A soma de ", num1, "e", num2, " é: ", num1 + num2)
elif op == ... | true | true |
1c18f3c9b50558828c743d53108551639d5a64e0 | 5,188 | py | Python | data/p3BR/R1/benchmark/startQiskit_Class123.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R1/benchmark/startQiskit_Class123.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R1/benchmark/startQiskit_Class123.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=22
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from... | 28.822222 | 140 | 0.628566 |
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from qiskit.test.mock import FakeVigo, ... | true | true |
1c18f49852a15ae9a031b50fc7273cc965f5a739 | 1,702 | py | Python | test/test_simple_zero.py | lazykyama/rannc | 0ed790babed46f9cbc6194b5277afd27101975bd | [
"MIT"
] | 1 | 2021-06-21T14:15:37.000Z | 2021-06-21T14:15:37.000Z | test/test_simple_zero.py | lazykyama/rannc | 0ed790babed46f9cbc6194b5277afd27101975bd | [
"MIT"
] | null | null | null | test/test_simple_zero.py | lazykyama/rannc | 0ed790babed46f9cbc6194b5277afd27101975bd | [
"MIT"
] | null | null | null | from . import common, models
def test_basic(init_dist, batch_size, iteration):
print("test_basic")
common.run(models.BasicModel(), batch_size, iteration, enable_zero=True)
def test_small_param(init_dist, batch_size, iteration):
print("test_small_param")
common.run(models.SmallParamModel(), batch_s... | 30.945455 | 109 | 0.766745 | from . import common, models
def test_basic(init_dist, batch_size, iteration):
print("test_basic")
common.run(models.BasicModel(), batch_size, iteration, enable_zero=True)
def test_small_param(init_dist, batch_size, iteration):
print("test_small_param")
common.run(models.SmallParamModel(), batch_s... | true | true |
1c18f5635897d834699d73afea5772ff05386549 | 3,265 | py | Python | src/private/scripts/reports/exposure/exposureHtmlTable.py | victor-t/tblBuilder | e1a0d4f625931be4c7ad7d659ce5f0e06c58a7b2 | [
"MIT"
] | 2 | 2017-08-24T16:38:08.000Z | 2018-06-19T13:00:52.000Z | src/private/scripts/reports/exposure/exposureHtmlTable.py | victor-t/tblBuilder | e1a0d4f625931be4c7ad7d659ce5f0e06c58a7b2 | [
"MIT"
] | 3 | 2018-01-24T17:10:03.000Z | 2018-04-23T19:54:26.000Z | src/private/scripts/reports/exposure/exposureHtmlTable.py | victor-t/tblBuilder | e1a0d4f625931be4c7ad7d659ce5f0e06c58a7b2 | [
"MIT"
] | 2 | 2019-02-12T21:16:54.000Z | 2022-02-11T21:09:03.000Z | # -*- coding: utf-8 -*-
from textwrap import dedent
from docxUtils.reports import DOCXReport
from docxUtils.tables import TableMaker
class ExposureHtmlTable(DOCXReport):
def create_content(self):
self.setLandscape()
doc = self.doc
d = self.context
txt = f'{d["table"]["volumeNumbe... | 29.954128 | 95 | 0.503828 | from textwrap import dedent
from docxUtils.reports import DOCXReport
from docxUtils.tables import TableMaker
class ExposureHtmlTable(DOCXReport):
def create_content(self):
self.setLandscape()
doc = self.doc
d = self.context
txt = f'{d["table"]["volumeNumber"]} {d["table"]["monogr... | true | true |
1c18f571d2d9f68220332b5ba8cb52bff4ae323e | 545 | py | Python | sortandsearch/first_bad_version.py | kandarpck/leetcode | d2ffcccede5d1543aea48f18a39cdbd3d83e3ed8 | [
"MIT"
] | null | null | null | sortandsearch/first_bad_version.py | kandarpck/leetcode | d2ffcccede5d1543aea48f18a39cdbd3d83e3ed8 | [
"MIT"
] | null | null | null | sortandsearch/first_bad_version.py | kandarpck/leetcode | d2ffcccede5d1543aea48f18a39cdbd3d83e3ed8 | [
"MIT"
] | null | null | null | class Solution:
def isBadVersion(self, version):
if version >= 4:
return True
def firstBadVersion(self, n):
"""
Time: log N
Space: 1
:type n: int
:rtype: int
"""
left, right = 1, n
while left <= right:
mid = (left ... | 20.961538 | 41 | 0.458716 | class Solution:
def isBadVersion(self, version):
if version >= 4:
return True
def firstBadVersion(self, n):
left, right = 1, n
while left <= right:
mid = (left + right) // 2
if self.isBadVersion(mid):
right = mid - 1
else:... | true | true |
1c18f710c5d8ba38a59cb2bccc98e7c62744f109 | 306 | py | Python | strr.py | jatinchaudhary/python_dump | 5f7d63237fcb96a66bc3c4151599c7849f0f2735 | [
"bzip2-1.0.6"
] | null | null | null | strr.py | jatinchaudhary/python_dump | 5f7d63237fcb96a66bc3c4151599c7849f0f2735 | [
"bzip2-1.0.6"
] | null | null | null | strr.py | jatinchaudhary/python_dump | 5f7d63237fcb96a66bc3c4151599c7849f0f2735 | [
"bzip2-1.0.6"
] | null | null | null | a=input()
for i in range(len(a)-1,-1,-1):
if(a[i-1]==" " or i==0):
for j in range(i,len(a)):
print(a[j],end="")
if(a[j]==" "):
break;
print(" ",end="")
| 13.909091 | 34 | 0.248366 | a=input()
for i in range(len(a)-1,-1,-1):
if(a[i-1]==" " or i==0):
for j in range(i,len(a)):
print(a[j],end="")
if(a[j]==" "):
break;
print(" ",end="")
| true | true |
1c18f7e2d5fd39c630da961a82f53531fd0826ef | 490 | py | Python | ytelapi/models/numbertype_1_enum.py | Ytel-Inc/YtelAPI-Python | 139dc02d93e74c78b6c3d91e3002ae98e2270223 | [
"MIT"
] | null | null | null | ytelapi/models/numbertype_1_enum.py | Ytel-Inc/YtelAPI-Python | 139dc02d93e74c78b6c3d91e3002ae98e2270223 | [
"MIT"
] | null | null | null | ytelapi/models/numbertype_1_enum.py | Ytel-Inc/YtelAPI-Python | 139dc02d93e74c78b6c3d91e3002ae98e2270223 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
ytelapi
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
class Numbertype1Enum(object):
"""Implementation of the 'Numbertype1' enum.
Number type either SMS,Voice or all
Attributes:
ALL: TODO: type description... | 17.5 | 84 | 0.569388 |
class Numbertype1Enum(object):
ALL = 'all'
VOICE = 'voice'
SMS = 'sms'
| true | true |
1c18f844434a09cab09bdfb72c55ae99aeaa0957 | 788 | py | Python | AtC_Beg_Con_081-090/ABC082/C.py | yosho-18/AtCoder | 50f6d5c92a01792552c31ac912ce1cd557b06fb0 | [
"MIT"
] | null | null | null | AtC_Beg_Con_081-090/ABC082/C.py | yosho-18/AtCoder | 50f6d5c92a01792552c31ac912ce1cd557b06fb0 | [
"MIT"
] | null | null | null | AtC_Beg_Con_081-090/ABC082/C.py | yosho-18/AtCoder | 50f6d5c92a01792552c31ac912ce1cd557b06fb0 | [
"MIT"
] | null | null | null | n = int(input())
a = input().split()
a = [int(m) for m in a]
a.sort()
sym = 0
symc = 0
delc = 0
for i in range(n):
if i == 0 and n == 1:
if a[i] == 1:
delc = 0
else:
delc = 1
elif i == 0:
sym = a[i]
symc += 1
elif a[i] != a[i - 1]:
if symc < a... | 20.205128 | 35 | 0.345178 | n = int(input())
a = input().split()
a = [int(m) for m in a]
a.sort()
sym = 0
symc = 0
delc = 0
for i in range(n):
if i == 0 and n == 1:
if a[i] == 1:
delc = 0
else:
delc = 1
elif i == 0:
sym = a[i]
symc += 1
elif a[i] != a[i - 1]:
if symc < a... | true | true |
1c18f8c2b29aebf5b68e0d301de2836a5b89ae15 | 324 | py | Python | catalyst/data/__init__.py | andrey-avdeev/catalyst | fd17aaba7775c99b7e2b1ce86e60aa8f2379acc3 | [
"Apache-2.0"
] | 1 | 2019-12-15T18:29:15.000Z | 2019-12-15T18:29:15.000Z | catalyst/data/__init__.py | andrey-avdeev/catalyst | fd17aaba7775c99b7e2b1ce86e60aa8f2379acc3 | [
"Apache-2.0"
] | null | null | null | catalyst/data/__init__.py | andrey-avdeev/catalyst | fd17aaba7775c99b7e2b1ce86e60aa8f2379acc3 | [
"Apache-2.0"
] | 1 | 2020-04-16T10:20:00.000Z | 2020-04-16T10:20:00.000Z | # flake8: noqa
from .augmentor import Augmentor, AugmentorKeys
from .collate_fn import FilteringCollateFn
from .dataset import ListDataset, MergeDataset
from .reader import (
ImageReader, LambdaReader, MaskReader, ReaderCompose, ReaderSpec,
ScalarReader
)
from .sampler import BalanceClassSampler, MiniEpochSamp... | 29.454545 | 69 | 0.817901 |
from .augmentor import Augmentor, AugmentorKeys
from .collate_fn import FilteringCollateFn
from .dataset import ListDataset, MergeDataset
from .reader import (
ImageReader, LambdaReader, MaskReader, ReaderCompose, ReaderSpec,
ScalarReader
)
from .sampler import BalanceClassSampler, MiniEpochSampler
| true | true |
1c18f9235e7b33e08187e31ada5550dda5125f36 | 7,146 | py | Python | tests/utils.py | JJCL2432/d01-p07-cerna-vazquex | 2c5e988c1e3a2cf6095754f29634bdae3c3b90cc | [
"BSD-3-Clause"
] | 3 | 2019-07-20T14:05:50.000Z | 2019-08-04T18:08:51.000Z | tests/utils.py | JJCL2432/d01-p07-cerna-vazquex | 2c5e988c1e3a2cf6095754f29634bdae3c3b90cc | [
"BSD-3-Clause"
] | 14 | 2018-02-22T10:52:07.000Z | 2018-02-28T10:19:51.000Z | tests/utils.py | JJCL2432/d01-p07-cerna-vazquex | 2c5e988c1e3a2cf6095754f29634bdae3c3b90cc | [
"BSD-3-Clause"
] | null | null | null | # coding=utf-8
"""Utilities for HTTPie test suite."""
import os
import sys
import time
import json
import tempfile
from httpie import ExitStatus, EXIT_STATUS_LABELS
from httpie.context import Environment
from httpie.core import main
from httpie.compat import bytes, str
TESTS_ROOT = os.path.abspath(os.path.dirname(__... | 28.023529 | 80 | 0.56885 | import os
import sys
import time
import json
import tempfile
from httpie import ExitStatus, EXIT_STATUS_LABELS
from httpie.context import Environment
from httpie.core import main
from httpie.compat import bytes, str
TESTS_ROOT = os.path.abspath(os.path.dirname(__file__))
CRLF = '\r\n'
COLOR = '\x1b['
HTTP_OK = '200 ... | true | true |
1c18f97d4042af31c9f5be06117be07e5a03f178 | 3,429 | py | Python | rasa_core/policies/trainer.py | jenish-cj/botnlufoodrest | b41aa2c7a1f6e492e10f07e67562b612b5b13a53 | [
"Apache-2.0"
] | 1 | 2017-12-27T04:07:24.000Z | 2017-12-27T04:07:24.000Z | rasa_core/policies/trainer.py | jenish-cj/botnlufoodrest | b41aa2c7a1f6e492e10f07e67562b612b5b13a53 | [
"Apache-2.0"
] | null | null | null | rasa_core/policies/trainer.py | jenish-cj/botnlufoodrest | b41aa2c7a1f6e492e10f07e67562b612b5b13a53 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import numpy as np
from builtins import object
from rasa_core.domain import check_domain_sanity
from rasa_core.interpreter import RegexInterpreter
logge... | 42.8625 | 80 | 0.604258 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import numpy as np
from builtins import object
from rasa_core.domain import check_domain_sanity
from rasa_core.interpreter import RegexInterpreter
logge... | true | true |
1c18f9e38cababca2e90441db05843310ab7878e | 11,398 | py | Python | tools/downloader/downloader.py | kokandeep/open_model_zoo | efd238d02035f8a5417b7b1e25cd4c997d44351f | [
"Apache-2.0"
] | 1 | 2020-02-09T15:50:35.000Z | 2020-02-09T15:50:35.000Z | tools/downloader/downloader.py | kokandeep/open_model_zoo | efd238d02035f8a5417b7b1e25cd4c997d44351f | [
"Apache-2.0"
] | 8 | 2020-09-26T00:40:13.000Z | 2022-03-12T00:14:30.000Z | tools/downloader/downloader.py | kokandeep/open_model_zoo | efd238d02035f8a5417b7b1e25cd4c997d44351f | [
"Apache-2.0"
] | 4 | 2020-04-21T17:31:00.000Z | 2021-10-18T07:04:49.000Z | #!/usr/bin/env python3
"""
Copyright (c) 2018 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... | 38.901024 | 122 | 0.652132 |
import argparse
import hashlib
import re
import requests
import shlex
import shutil
import ssl
import sys
import tempfile
import time
from pathlib import Path
import common
CHUNK_SIZE = 1 << 15 if sys.stdout.isatty() else 1 << 20
def process_download(reporter, chunk_iterable, size, file):
start_time = time.mo... | true | true |
1c18fa0c80d7bee5a4c2ec0fcb460c21f448b857 | 2,993 | py | Python | plugins/shortener/shortener.py | jatin837/elc.github.io | 7f6babe1838b3bb4c4089eeb2a3cdc7878054d60 | [
"MIT"
] | null | null | null | plugins/shortener/shortener.py | jatin837/elc.github.io | 7f6babe1838b3bb4c4089eeb2a3cdc7878054d60 | [
"MIT"
] | 9 | 2019-01-16T02:48:22.000Z | 2022-03-11T23:43:34.000Z | plugins/shortener/shortener.py | jatin837/elc.github.io | 7f6babe1838b3bb4c4089eeb2a3cdc7878054d60 | [
"MIT"
] | 1 | 2021-08-05T18:07:46.000Z | 2021-08-05T18:07:46.000Z | # -*- coding: utf-8 -*-
'''
Shortener
-------
The shortener plugin generates plain HTML files for redirects inside the output
directory, it integrates easily with google analytics
It works with no no dependencies apart from pelican itself.
Copyright (c) 2018 Ezequiel Leonardo Castaño
'''
import os
from pelican impo... | 29.058252 | 91 | 0.656532 |
import os
from pelican import signals
import json
def generate_output(sender):
output_path = getattr(sender, 'output_path', None)
redirects_map = sender.settings.get('SHORTENER_LINKS', None)
shortener_file = sender.settings.get('SHORTENER_FILE', None)
analytics = sender.settings.get('GOOGLE_ANALYT... | true | true |
1c18fa1a5cdc37e14f1681d63f4be75a729d6367 | 153,708 | py | Python | lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py | scholtalbers/galaxy | 7bb8376490a251573252177ab4112caba64b4684 | [
"CC-BY-3.0"
] | 1 | 2019-11-03T11:45:43.000Z | 2019-11-03T11:45:43.000Z | lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py | scholtalbers/galaxy | 7bb8376490a251573252177ab4112caba64b4684 | [
"CC-BY-3.0"
] | 4 | 2017-05-24T19:36:34.000Z | 2019-08-23T02:49:18.000Z | lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py | VJalili/galaxy | b801a845c5297a23b992db46b1f9cabaee28a660 | [
"CC-BY-3.0"
] | null | null | null | import json
import logging
import os
import shutil
from six import string_types
from sqlalchemy import or_
import tool_shed.repository_types.util as rt_util
from admin import AdminGalaxy
from galaxy import util, web
from galaxy.tools.deps import views
from galaxy.web.form_builder import CheckboxField
from tool_shed.g... | 72.435438 | 179 | 0.57308 | import json
import logging
import os
import shutil
from six import string_types
from sqlalchemy import or_
import tool_shed.repository_types.util as rt_util
from admin import AdminGalaxy
from galaxy import util, web
from galaxy.tools.deps import views
from galaxy.web.form_builder import CheckboxField
from tool_shed.g... | true | true |
1c18fa3fe871eb883854e53fe489004d8512007a | 1,903 | py | Python | {{cookiecutter.project_name}}/server/settings/environments/development.py | alisher-matkurbanov/wemake-django-template | 28d17211d5a9f466a7281006a09775b1e6ad1ef1 | [
"MIT"
] | 3 | 2020-02-26T05:57:13.000Z | 2020-03-09T17:07:18.000Z | {{cookiecutter.project_name}}/server/settings/environments/development.py | neilwithdata/wemake-django-template | fde107312b7649483c65d118e172045ff362482c | [
"MIT"
] | null | null | null | {{cookiecutter.project_name}}/server/settings/environments/development.py | neilwithdata/wemake-django-template | fde107312b7649483c65d118e172045ff362482c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
This file contains all the settings that defines the development server.
SECURITY WARNING: don't run with debug turned on in production!
"""
import logging
from typing import List
from server.settings.components import config
from server.settings.components.common import INSTALLED_APPS, ... | 23.207317 | 82 | 0.729375 |
import logging
from typing import List
from server.settings.components import config
from server.settings.components.common import INSTALLED_APPS, MIDDLEWARE
DEBUG = True
ALLOWED_HOSTS = [
config('DOMAIN_NAME'),
'localhost',
'127.0.0.1',
'[::1]',
]
INSTALLED_APPS += (
'debug_toolbar',
'... | true | true |
1c18fa784ee1f2ea69ee31c62411756191ec4659 | 1,000 | py | Python | classes/util/text.py | JeanExtreme002/Asteroids-Escape | 5ef4f3bb613408dc45c59c07b261e1c89b655b70 | [
"BSD-3-Clause"
] | 1 | 2019-12-26T18:41:24.000Z | 2019-12-26T18:41:24.000Z | classes/util/text.py | JeanExtreme002/Asteroids-Escape | 5ef4f3bb613408dc45c59c07b261e1c89b655b70 | [
"BSD-3-Clause"
] | null | null | null | classes/util/text.py | JeanExtreme002/Asteroids-Escape | 5ef4f3bb613408dc45c59c07b261e1c89b655b70 | [
"BSD-3-Clause"
] | null | null | null | from pygame import font
class Text(object):
def __init__(self, window, text_font):
self.__window = window
self.__font = font.Font(*text_font)
def draw(self, text, x, y , color = [255,255,255], place = "center", outline = None):
place = place.lower()
if place != "left":
... | 25.641026 | 89 | 0.545 | from pygame import font
class Text(object):
def __init__(self, window, text_font):
self.__window = window
self.__font = font.Font(*text_font)
def draw(self, text, x, y , color = [255,255,255], place = "center", outline = None):
place = place.lower()
if place != "left":
... | true | true |
1c18fb6070c8700d84e102948386ee3e1b10ea4f | 81,316 | py | Python | src/transformers/file_utils.py | AlekseyKorshuk/transformers | 3ff2cde5ca4a2d3c622b827d9edf7e3d0b7f4fb7 | [
"Apache-2.0"
] | 15 | 2021-08-10T01:10:44.000Z | 2022-01-20T15:23:49.000Z | src/transformers/file_utils.py | 4nalog/transformers | 76cadb7943c8492ec481f4f3925e9e8793a32c9d | [
"Apache-2.0"
] | null | null | null | src/transformers/file_utils.py | 4nalog/transformers | 76cadb7943c8492ec481f4f3925e9e8793a32c9d | [
"Apache-2.0"
] | 1 | 2021-04-02T20:42:10.000Z | 2021-04-02T20:42:10.000Z | # Copyright 2020 The HuggingFace Team, the AllenNLP library 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
#
... | 36.911484 | 150 | 0.665269 | import copy
import fnmatch
import functools
import importlib.util
import io
import json
import os
import re
import shutil
import subprocess
import sys
import tarfile
import tempfile
import types
from collections import OrderedDict, UserDict
from contextlib import contextmanager
from dataclasses import fields
from enum ... | true | true |
1c18fbae560d764c229bccff95329028d1d05277 | 1,296 | py | Python | airbyte-integrations/connectors/source-intercom/main.py | luizgribeiro/airbyte | 71a96f5417b678c39b34e2e92234d8a51529e086 | [
"MIT"
] | 2 | 2021-08-04T03:17:38.000Z | 2021-11-15T10:16:08.000Z | airbyte-integrations/connectors/source-intercom/main.py | luizgribeiro/airbyte | 71a96f5417b678c39b34e2e92234d8a51529e086 | [
"MIT"
] | 52 | 2021-06-11T12:39:05.000Z | 2022-03-30T04:59:35.000Z | airbyte-integrations/connectors/source-intercom/main.py | luizgribeiro/airbyte | 71a96f5417b678c39b34e2e92234d8a51529e086 | [
"MIT"
] | 2 | 2021-12-14T17:15:40.000Z | 2021-12-14T17:18:03.000Z | #
# MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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, modify, merge, pu... | 38.117647 | 80 | 0.771605 |
import sys
from airbyte_cdk.entrypoint import launch
from source_intercom import SourceIntercom
if __name__ == "__main__":
source = SourceIntercom()
launch(source, sys.argv[1:])
| true | true |
1c18fc6a374994bb057c27011240df114fefc132 | 827 | py | Python | smartbot/plugins/decide.py | Muzer/smartbot | c18daac6b066a7d368ef3dd0848a21c16a076604 | [
"MIT"
] | null | null | null | smartbot/plugins/decide.py | Muzer/smartbot | c18daac6b066a7d368ef3dd0848a21c16a076604 | [
"MIT"
] | 11 | 2015-01-01T21:34:05.000Z | 2015-06-03T11:13:44.000Z | smartbot/plugins/decide.py | Muzer/smartbot | c18daac6b066a7d368ef3dd0848a21c16a076604 | [
"MIT"
] | null | null | null | import random
import shlex
import smartbot.plugin
from smartbot.exceptions import StopCommandWithHelp
from smartbot.formatting import Style
class Plugin(smartbot.plugin.Plugin):
"""
Save your brain for more important things by letting SmartBot make
important decisions for you.
"""
names = ["decid... | 25.84375 | 70 | 0.621524 | import random
import shlex
import smartbot.plugin
from smartbot.exceptions import StopCommandWithHelp
from smartbot.formatting import Style
class Plugin(smartbot.plugin.Plugin):
names = ["decide", "choose"]
def on_command(self, msg, stdin, stdout):
args = msg["args"][1:]
if not args:
... | true | true |
1c18fc8e3e2fc0906ae9f81a52605708f3d1dcf4 | 8,149 | py | Python | giveme/injector.py | steinitzu/giveme | 80e38a950d16f82b594a95bab249ecf689fe528b | [
"MIT"
] | 5 | 2017-08-01T12:03:07.000Z | 2021-08-31T17:42:03.000Z | giveme/injector.py | steinitzu/giveme | 80e38a950d16f82b594a95bab249ecf689fe528b | [
"MIT"
] | 6 | 2017-07-25T13:31:21.000Z | 2020-05-09T16:06:34.000Z | giveme/injector.py | steinitzu/giveme | 80e38a950d16f82b594a95bab249ecf689fe528b | [
"MIT"
] | 1 | 2017-07-24T23:40:25.000Z | 2017-07-24T23:40:25.000Z | import threading
import warnings
from functools import partial, wraps
from inspect import iscoroutinefunction, signature
from .deferredproperty import DeferredProperty
class DependencyNotFoundError(Exception):
pass
class DependencyNotFoundWarning(RuntimeWarning):
pass
ambigious_not_found_msg = (
'An ... | 32.337302 | 88 | 0.59676 | import threading
import warnings
from functools import partial, wraps
from inspect import iscoroutinefunction, signature
from .deferredproperty import DeferredProperty
class DependencyNotFoundError(Exception):
pass
class DependencyNotFoundWarning(RuntimeWarning):
pass
ambigious_not_found_msg = (
'An ... | true | true |
1c18fd0d21f9b85ec69abfd45e672271b615d826 | 4,208 | py | Python | onetimelink/models.py | HiroshiFuu/django-onetimelink | 73c1e4b255cb231420ac3e8765abfbdb50225f48 | [
"BSD-3-Clause"
] | 10 | 2019-11-25T12:38:55.000Z | 2021-09-15T01:34:05.000Z | onetimelink/models.py | HiroshiFuu/django-onetimelink | 73c1e4b255cb231420ac3e8765abfbdb50225f48 | [
"BSD-3-Clause"
] | 2 | 2021-08-23T11:28:32.000Z | 2022-02-04T11:26:42.000Z | onetimelink/models.py | HiroshiFuu/django-onetimelink | 73c1e4b255cb231420ac3e8765abfbdb50225f48 | [
"BSD-3-Clause"
] | 1 | 2021-09-15T07:29:28.000Z | 2021-09-15T07:29:28.000Z | from django.db import models
# Create your models here.
from django.db import models
from django.db import IntegrityError
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from . import presettings
from . import api
import os
class DownloadSite(models.Model):
class Meta:
... | 31.639098 | 121 | 0.609553 | from django.db import models
from django.db import models
from django.db import IntegrityError
from django.conf import settings
from django.utils.translation import ugettext_lazy as _
from . import presettings
from . import api
import os
class DownloadSite(models.Model):
class Meta:
verbose_name = 'Dow... | true | true |
1c18fe1e0874e9dd7238f5241945fd232e1900ba | 393 | py | Python | demo05-react-router-redux-server/ponynote/wsgi.py | diguage/react-demos | 9505f5fddea7e1a2a4a345d52a6b06828fde81ee | [
"Apache-2.0"
] | null | null | null | demo05-react-router-redux-server/ponynote/wsgi.py | diguage/react-demos | 9505f5fddea7e1a2a4a345d52a6b06828fde81ee | [
"Apache-2.0"
] | null | null | null | demo05-react-router-redux-server/ponynote/wsgi.py | diguage/react-demos | 9505f5fddea7e1a2a4a345d52a6b06828fde81ee | [
"Apache-2.0"
] | null | null | null | """
WSGI config for ponynote project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETT... | 23.117647 | 78 | 0.78626 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ponynote.settings')
application = get_wsgi_application()
| true | true |
1c18fe54b3aacff433c95b64163719869ff144c3 | 25,357 | py | Python | boruta/boruta_py.py | erikvdp/boruta_py | e04d1a17de142679eabebebd8cedde202587fbf1 | [
"BSD-3-Clause"
] | 996 | 2017-03-10T07:36:19.000Z | 2022-03-28T09:10:30.000Z | boruta/boruta_py.py | chrinide/boruta_py | e04d1a17de142679eabebebd8cedde202587fbf1 | [
"BSD-3-Clause"
] | 75 | 2017-04-27T18:41:34.000Z | 2021-12-08T09:38:53.000Z | boruta/boruta_py.py | chrinide/boruta_py | e04d1a17de142679eabebebd8cedde202587fbf1 | [
"BSD-3-Clause"
] | 213 | 2017-03-09T11:12:00.000Z | 2022-03-08T20:49:50.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Author: Daniel Homola <dani.homola@gmail.com>
Original code and method by: Miron B Kursa, https://m2.icm.edu.pl/boruta/
License: BSD 3 clause
"""
from __future__ import print_function, division
import numpy as np
import scipy as sp
from sklearn.utils import check_ran... | 39.744514 | 91 | 0.621958 |
from __future__ import print_function, division
import numpy as np
import scipy as sp
from sklearn.utils import check_random_state, check_X_y
from sklearn.base import TransformerMixin, BaseEstimator
import warnings
class BorutaPy(BaseEstimator, TransformerMixin):
def __init__(self, estimator, n_estimators=1000,... | true | true |
1c18fe69c2be845c8cdcffce25cbfbad796db6d2 | 9,193 | py | Python | code/compute_exact_yundi_infinite.py | AdityaMate/collapsing_bandits | 2aecccc6fd986f869088438ea5eba7bbfd5c1e91 | [
"MIT"
] | 6 | 2020-11-27T10:33:54.000Z | 2022-02-28T11:13:34.000Z | code/compute_exact_yundi_infinite.py | AdityaMate/collapsing_bandits | 2aecccc6fd986f869088438ea5eba7bbfd5c1e91 | [
"MIT"
] | null | null | null | code/compute_exact_yundi_infinite.py | AdityaMate/collapsing_bandits | 2aecccc6fd986f869088438ea5eba7bbfd5c1e91 | [
"MIT"
] | 1 | 2021-09-15T05:21:47.000Z | 2021-09-15T05:21:47.000Z | from __future__ import print_function
import numpy as np
import argparse
from itertools import product, combinations
from functools import reduce
from tqdm import tqdm
import subprocess
import os
import multiprocessing
import platform
# import special_pomdp
import traceback, functools, multiprocessing
def trace_un... | 25.536111 | 99 | 0.662243 | from __future__ import print_function
import numpy as np
import argparse
from itertools import product, combinations
from functools import reduce
from tqdm import tqdm
import subprocess
import os
import multiprocessing
import platform
import traceback, functools, multiprocessing
def trace_unhandled_exceptions(func... | true | true |
1c18feb545e5556c9dc330d6d46fecb334358215 | 993 | py | Python | overview_table/tests.py | VoSeq/VoSeq | 81f869391b7a8940a0ce89f0b6dba0a6967297f0 | [
"BSD-3-Clause"
] | 2 | 2019-08-20T04:16:12.000Z | 2020-08-25T02:05:12.000Z | overview_table/tests.py | VoSeq/VoSeq | 81f869391b7a8940a0ce89f0b6dba0a6967297f0 | [
"BSD-3-Clause"
] | 65 | 2016-09-27T23:14:51.000Z | 2022-03-19T14:17:58.000Z | overview_table/tests.py | VoSeq/VoSeq | 81f869391b7a8940a0ce89f0b6dba0a6967297f0 | [
"BSD-3-Clause"
] | 4 | 2018-07-02T16:57:44.000Z | 2021-03-23T02:12:15.000Z | from django.test import TestCase, Client
from django.conf import settings
from django.core.management import call_command
from overview_table.utils import OverviewTableMaker
class TestOverviewTable(TestCase):
def setUp(self):
args = []
opts = {'dumpfile': settings.MEDIA_ROOT + 'test_db_dump.xml',... | 29.205882 | 85 | 0.644512 | from django.test import TestCase, Client
from django.conf import settings
from django.core.management import call_command
from overview_table.utils import OverviewTableMaker
class TestOverviewTable(TestCase):
def setUp(self):
args = []
opts = {'dumpfile': settings.MEDIA_ROOT + 'test_db_dump.xml',... | true | true |
1c18ff0f58bfc9378e5bf6bd12d4e68d7be189da | 9,505 | py | Python | harutya-project/harutya-lol-api/app/server/opggApi.py | Old-Interest/Harutya | 8bfd34ee65d2a0acbae499ae6ae544336037b4b4 | [
"MIT"
] | null | null | null | harutya-project/harutya-lol-api/app/server/opggApi.py | Old-Interest/Harutya | 8bfd34ee65d2a0acbae499ae6ae544336037b4b4 | [
"MIT"
] | null | null | null | harutya-project/harutya-lol-api/app/server/opggApi.py | Old-Interest/Harutya | 8bfd34ee65d2a0acbae499ae6ae544336037b4b4 | [
"MIT"
] | null | null | null | __author__ = 'Harutya'
__date__ = '2021/07/02'
import re
import requests
import bs4
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3741.400 QQBrowser/10.5.3863.400",
"Accept-Language": "zh-CN,zh;q=0.9"
}
web_champion = {}
item = {}
url = 'http://ww... | 33.705674 | 134 | 0.625776 | __author__ = 'Harutya'
__date__ = '2021/07/02'
import re
import requests
import bs4
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) Chrome/70.0.3538.25 Safari/537.36 Core/1.70.3741.400 QQBrowser/10.5.3863.400",
"Accept-Language": "zh-CN,zh;q=0.9"
}
web_champion = {}
item = {}
url = 'http://ww... | true | true |
1c18ff30b6520ee6935637b43fad3bd1bd03f7f8 | 4,447 | py | Python | tf_agents/policies/q_policy.py | andreas-eberle/agents | c355882d35273b889b84f90071d91ee6354d27d3 | [
"Apache-2.0"
] | null | null | null | tf_agents/policies/q_policy.py | andreas-eberle/agents | c355882d35273b889b84f90071d91ee6354d27d3 | [
"Apache-2.0"
] | null | null | null | tf_agents/policies/q_policy.py | andreas-eberle/agents | c355882d35273b889b84f90071d91ee6354d27d3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The TF-Agents Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 40.063063 | 80 | 0.716888 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gin
import tensorflow as tf
from tf_agents.distributions import shifted_categorical
from tf_agents.policies import tf_policy
from tf_agents.trajectories import policy_step
@gin.configurable
class QP... | true | true |
1c18ff51a80178f5b300d33916408ef434ed42d3 | 1,171 | py | Python | examples/futaba/futaba_read_write.py | karakuri-products/gs2d-python | e2e72529b8157f0d27f1f9e718b2b3d111867da2 | [
"Apache-2.0"
] | 7 | 2020-08-28T11:46:18.000Z | 2020-12-31T06:58:17.000Z | examples/futaba/futaba_read_write.py | karakuri-products/gs2d-python | e2e72529b8157f0d27f1f9e718b2b3d111867da2 | [
"Apache-2.0"
] | null | null | null | examples/futaba/futaba_read_write.py | karakuri-products/gs2d-python | e2e72529b8157f0d27f1f9e718b2b3d111867da2 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
# encoding: utf-8
import sys
import time
import logging
sys.path.insert(0, '../..')
from gs2d import SerialInterface, Futaba
# ログ設定
logging.basicConfig()
logging.getLogger('gs2d').setLevel(level=logging.DEBUG)
try:
# 初期化
si = SerialInterface()
futaba = Futaba(si)
# 電圧をreadで取... | 24.914894 | 86 | 0.662681 |
import sys
import time
import logging
sys.path.insert(0, '../..')
from gs2d import SerialInterface, Futaba
logging.basicConfig()
logging.getLogger('gs2d').setLevel(level=logging.DEBUG)
try:
si = SerialInterface()
futaba = Futaba(si)
response_data = futaba.read(1, Futaba.ADDR_VOLTAGE_L, 2)
v... | true | true |
1c18fff43e3f8027382077296497b312a208e352 | 9,405 | py | Python | holoviews/plotting/mpl/__init__.py | stonebig/holoviews | d5270c30dd1af38a785452aeac2fbabbe528e892 | [
"BSD-3-Clause"
] | null | null | null | holoviews/plotting/mpl/__init__.py | stonebig/holoviews | d5270c30dd1af38a785452aeac2fbabbe528e892 | [
"BSD-3-Clause"
] | null | null | null | holoviews/plotting/mpl/__init__.py | stonebig/holoviews | d5270c30dd1af38a785452aeac2fbabbe528e892 | [
"BSD-3-Clause"
] | null | null | null | import os
from distutils.version import LooseVersion
from matplotlib import rc_params_from_file
from matplotlib.colors import ListedColormap
from ...core import Layout, Collator, GridMatrix, config
from ...core.options import Cycle, Palette, Options
from ...core.overlay import NdOverlay, Overlay
from ...element impor... | 37.47012 | 93 | 0.629984 | import os
from distutils.version import LooseVersion
from matplotlib import rc_params_from_file
from matplotlib.colors import ListedColormap
from ...core import Layout, Collator, GridMatrix, config
from ...core.options import Cycle, Palette, Options
from ...core.overlay import NdOverlay, Overlay
from ...element impor... | true | true |
1c1900b546cbcddbc6774a37c3bc640351247aed | 4,842 | py | Python | huaweicloud-sdk-as/huaweicloudsdkas/v1/model/bandwidth_result.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2021-11-03T07:54:50.000Z | 2021-11-03T07:54:50.000Z | huaweicloud-sdk-as/huaweicloudsdkas/v1/model/bandwidth_result.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-as/huaweicloudsdkas/v1/model/bandwidth_result.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class BandwidthResult:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is... | 25.21875 | 80 | 0.553284 |
import pprint
import re
import six
class BandwidthResult:
sensitive_list = []
openapi_types = {
'size': 'int',
'share_type': 'str',
'charging_mode': 'str',
'id': 'str'
}
attribute_map = {
'size': 'size',
'share_type': 'share_type',
'cha... | true | true |
1c1900bc7d58fe8e92c5706cef584b57a14c1ede | 237 | py | Python | topCoder/srms/300s/srm344/div2/chess_board.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-09-30T19:53:08.000Z | 2020-09-30T19:53:08.000Z | topCoder/srms/300s/srm344/div2/chess_board.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | null | null | null | topCoder/srms/300s/srm344/div2/chess_board.py | gauravsingh58/algo | 397859a53429e7a585e5f6964ad24146c6261326 | [
"WTFPL"
] | 1 | 2020-10-15T09:10:57.000Z | 2020-10-15T09:10:57.000Z | class Chessboard:
def changeNotation(self, cell):
try:
n = int(cell) - 1
return chr(n%8 + ord('a')) + str(n/8+1)
except:
return (int(cell[1]) - 1) * 8 + ord(cell[0]) - ord('a') + 1
| 29.625 | 71 | 0.455696 | class Chessboard:
def changeNotation(self, cell):
try:
n = int(cell) - 1
return chr(n%8 + ord('a')) + str(n/8+1)
except:
return (int(cell[1]) - 1) * 8 + ord(cell[0]) - ord('a') + 1
| true | true |
1c19012715c4eb3cc5622870a9dab76ad851848b | 4,714 | py | Python | pomdp_problems/tag/agent/agent.py | Semanti1/pomdp_findit | b96c1c06aab4b485fa005654cf6438ff63718083 | [
"MIT"
] | null | null | null | pomdp_problems/tag/agent/agent.py | Semanti1/pomdp_findit | b96c1c06aab4b485fa005654cf6438ff63718083 | [
"MIT"
] | null | null | null | pomdp_problems/tag/agent/agent.py | Semanti1/pomdp_findit | b96c1c06aab4b485fa005654cf6438ff63718083 | [
"MIT"
] | null | null | null | import pomdp_py
import copy
import random
from pomdp_problems.tag.domain.observation import *
from pomdp_problems.tag.domain.action import *
from pomdp_problems.tag.domain.state import *
from pomdp_problems.tag.models.observation_model import *
from pomdp_problems.tag.models.transition_model import *
from pomdp... | 38.639344 | 103 | 0.606279 | import pomdp_py
import copy
import random
from pomdp_problems.tag.domain.observation import *
from pomdp_problems.tag.domain.action import *
from pomdp_problems.tag.domain.state import *
from pomdp_problems.tag.models.observation_model import *
from pomdp_problems.tag.models.transition_model import *
from pomdp... | true | true |
1c1901df3fd80072c1bca3e612fb5f9828b71138 | 1,512 | py | Python | tests/unittests/engine/test_op.py | krishnakatyal/towhee | c5e043aa1509cf46644ca6b53f691d6ed2647212 | [
"Apache-2.0"
] | null | null | null | tests/unittests/engine/test_op.py | krishnakatyal/towhee | c5e043aa1509cf46644ca6b53f691d6ed2647212 | [
"Apache-2.0"
] | 1 | 2022-01-19T06:21:07.000Z | 2022-01-19T06:21:07.000Z | tests/unittests/engine/test_op.py | jennyli-z/towhee | 55c55fd961229575b75eae269b55090c839f8dcd | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Zilliz. 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 agree... | 27.490909 | 74 | 0.683201 |
import unittest
from pathlib import Path
from towhee.operator.base import Operator
from towhee.engine.factory import op
CACHE_PATH = Path(__file__).parent.parent.resolve()
class TestOperator(Operator):
def __init__(self, x:int):
self.x = x
def __call__(self, y:int) -> int:
return self.x + ... | true | true |
1c190204a5306b0e554e4ffaf5b6cf93a6dd2931 | 22,292 | py | Python | src/toil/test/wdl/builtinTest.py | Hexotical/toil | 312b6e1f221ee7f7f187dd6dbfce1aecffd00e09 | [
"Apache-2.0"
] | 516 | 2015-07-30T19:08:55.000Z | 2018-07-03T20:53:42.000Z | src/toil/test/wdl/builtinTest.py | Hexotical/toil | 312b6e1f221ee7f7f187dd6dbfce1aecffd00e09 | [
"Apache-2.0"
] | 1,949 | 2015-07-29T23:38:49.000Z | 2018-07-05T12:42:04.000Z | src/toil/test/wdl/builtinTest.py | gmloose/toil | a82834073b28f66747c5c3ac99d1a678b82d2290 | [
"Apache-2.0"
] | 193 | 2015-07-31T18:52:57.000Z | 2018-07-05T08:54:11.000Z | import json
import os
import shutil
import subprocess
import unittest
import uuid
from typing import List, Optional
from toil.test import ToilTest
from toil.version import exactPython
from toil.wdl.wdl_functions import (WDLPair,
WDLRuntimeError,
c... | 43.968442 | 117 | 0.586354 | import json
import os
import shutil
import subprocess
import unittest
import uuid
from typing import List, Optional
from toil.test import ToilTest
from toil.version import exactPython
from toil.wdl.wdl_functions import (WDLPair,
WDLRuntimeError,
c... | true | true |
1c1903e56c4f27540f55e83d72828c1afc10b9cd | 130 | py | Python | students/K33402/Livasily/lr3/FlexAir3/frontend/urls.py | jabkevich/ITMO_ICT_WebDevelopment_2020-2021 | b2bfbcf53d061e20f8c13d2fe662a4df2022d09b | [
"MIT"
] | null | null | null | students/K33402/Livasily/lr3/FlexAir3/frontend/urls.py | jabkevich/ITMO_ICT_WebDevelopment_2020-2021 | b2bfbcf53d061e20f8c13d2fe662a4df2022d09b | [
"MIT"
] | null | null | null | students/K33402/Livasily/lr3/FlexAir3/frontend/urls.py | jabkevich/ITMO_ICT_WebDevelopment_2020-2021 | b2bfbcf53d061e20f8c13d2fe662a4df2022d09b | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path, include
from .views import *
urlpatterns = [
path('', index)
]
| 18.571429 | 37 | 0.723077 | from django.contrib import admin
from django.urls import path, include
from .views import *
urlpatterns = [
path('', index)
]
| true | true |
1c19041a6ef8183e86fcb2d08d64b25348f46186 | 5,341 | py | Python | lizepy/__init__.py | alexandre-archive/lizepy | 874305d3bddaf13926b04f1939b0e5336d0b53d9 | [
"MIT"
] | null | null | null | lizepy/__init__.py | alexandre-archive/lizepy | 874305d3bddaf13926b04f1939b0e5336d0b53d9 | [
"MIT"
] | null | null | null | lizepy/__init__.py | alexandre-archive/lizepy | 874305d3bddaf13926b04f1939b0e5336d0b53d9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Alexandre Vicenzi'
__version__ = '0.4.0'
__license__ = 'MIT'
'''
The MIT License (MIT)
Copyright (c) 2014 Alexandre Vicenzi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (th... | 31.791667 | 97 | 0.63827 |
__author__ = 'Alexandre Vicenzi'
__version__ = '0.4.0'
__license__ = 'MIT'
import json
import sys
if sys.version_info[0] == 2:
from urllib2 import Request, urlopen, HTTPError
elif sys.version_info[0] == 3:
from urllib.request import Request, urlopen
from urllib.error import HTTPError
else:
raise Imp... | true | true |
1c19041bee293854b22e4b06c21236e949de40b4 | 1,853 | py | Python | osmchadjango/users/serializers.py | nrotstan/osmcha-django | f5db7d4d369cfab88f92d14eeb63e6f296c3b52d | [
"BSD-2-Clause"
] | 27 | 2015-09-06T00:39:39.000Z | 2021-12-09T10:30:52.000Z | osmchadjango/users/serializers.py | nrotstan/osmcha-django | f5db7d4d369cfab88f92d14eeb63e6f296c3b52d | [
"BSD-2-Clause"
] | 494 | 2015-09-10T19:39:38.000Z | 2022-03-29T08:07:37.000Z | osmchadjango/users/serializers.py | nrotstan/osmcha-django | f5db7d4d369cfab88f92d14eeb63e6f296c3b52d | [
"BSD-2-Clause"
] | 17 | 2015-08-10T22:58:56.000Z | 2021-09-24T17:03:16.000Z | from django.contrib.auth import get_user_model
from rest_framework.serializers import (
ModelSerializer, Serializer, CharField, SlugRelatedField
)
from rest_framework.fields import ReadOnlyField
from rest_framework.fields import SerializerMethodField
from .models import MappingTeam
class UserSerializer(Mode... | 28.507692 | 78 | 0.634647 | from django.contrib.auth import get_user_model
from rest_framework.serializers import (
ModelSerializer, Serializer, CharField, SlugRelatedField
)
from rest_framework.fields import ReadOnlyField
from rest_framework.fields import SerializerMethodField
from .models import MappingTeam
class UserSerializer(Mode... | true | true |
1c19043fbf01b19fdf20b74536441182ca6dbacb | 8,218 | py | Python | c2cgeoportal/views/mapserverproxy.py | craxxkid/c2cgeoportal | 60ca7d5d014d69b0a938f858271c911a30da77c3 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | c2cgeoportal/views/mapserverproxy.py | craxxkid/c2cgeoportal | 60ca7d5d014d69b0a938f858271c911a30da77c3 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | c2cgeoportal/views/mapserverproxy.py | craxxkid/c2cgeoportal | 60ca7d5d014d69b0a938f858271c911a30da77c3 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2011-2016, Camptocamp SA
# 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
#... | 40.284314 | 96 | 0.62643 |
import logging
from pyramid.view import view_config
from c2cgeoportal.lib.caching import get_region, NO_CACHE, PUBLIC_CACHE, PRIVATE_CACHE
from c2cgeoportal.lib.functionality import get_mapserver_substitution_params
from c2cgeoportal.lib.filter_capabilities import filter_capabilities
from c2cgeoportal.views.pr... | true | true |
1c19047b37b4cfeec58374f56ae15926dd7904e0 | 4,445 | py | Python | gallery/settings.py | Hawa-Evakali/Gallery | 1fdf3bfe74059e9d365d79e5ffb64cbae213431d | [
"MIT"
] | null | null | null | gallery/settings.py | Hawa-Evakali/Gallery | 1fdf3bfe74059e9d365d79e5ffb64cbae213431d | [
"MIT"
] | null | null | null | gallery/settings.py | Hawa-Evakali/Gallery | 1fdf3bfe74059e9d365d79e5ffb64cbae213431d | [
"MIT"
] | null | null | null | """
Django settings for gallery project.
Generated by 'django-admin startproject' using Django 4.0.3.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/topics/settings/
For the full list of settings and theiSTATIC_URL = 'static/' values, see
https://docs.djangoproject.com/en/4.0/ref/settin... | 25.255682 | 91 | 0.696513 |
from pathlib import Path
import os
import django_on_heroku
from decouple import config,Csv
import dj_database_url
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'django-insecure-+b=9--0c!dk!+tc!)k5+ig6tb0n^7@_b41byxx_!-nsc@$-93z'
MODE=config("MODE", default="dev")
SECRET_KEY =... | true | true |
1c190489f2035ef2f2f0839a6310185aad78b6ee | 2,714 | py | Python | tools/misc/profile.py | v8786339/NyuziProcessor | 34854d333d91dbf69cd5625505fb81024ec4f785 | [
"Apache-2.0"
] | 1,388 | 2015-02-05T17:16:17.000Z | 2022-03-31T07:17:08.000Z | tools/misc/profile.py | czvf/NyuziProcessor | 31f74e43a785fa66d244f1e9744ca0ca9b8a1fad | [
"Apache-2.0"
] | 176 | 2015-02-02T02:54:06.000Z | 2022-02-01T06:00:21.000Z | tools/misc/profile.py | czvf/NyuziProcessor | 31f74e43a785fa66d244f1e9744ca0ca9b8a1fad | [
"Apache-2.0"
] | 271 | 2015-02-18T02:19:04.000Z | 2022-03-28T13:30:25.000Z | #!/usr/bin/env python3
#
# Copyright 2011-2015 Jeff Bush
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 27.414141 | 82 | 0.610538 |
import sys
import re
symbolre = re.compile(
r'(?P<addr>[A-Fa-f0-9]+) g\s+F\s+\.text\s+[A-Fa-f0-9]+\s+(?P<symbol>\w+)')
def find_function(functions, pc):
low = 0
high = len(functions)
while low < high:
mid = int((low + high) / 2)
if pc < functions[mid][0]:
high = mid
... | true | true |
1c1904cb9e7e743e6ed1151fdce5c1823a525a0d | 406 | py | Python | archive/polls/urls.py | OhEvolve/LabBio | 4495f70ea544e0c7208d51abcb1469adcb84fc1b | [
"MIT"
] | null | null | null | archive/polls/urls.py | OhEvolve/LabBio | 4495f70ea544e0c7208d51abcb1469adcb84fc1b | [
"MIT"
] | null | null | null | archive/polls/urls.py | OhEvolve/LabBio | 4495f70ea544e0c7208d51abcb1469adcb84fc1b | [
"MIT"
] | null | null | null |
from django.urls import path
from . import views
app_name = 'polls'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('<int:pk>/', views.DetailView.as_view(), name='detail'),
path('<int:pk>/results/', views.ResultsView.as_view(), name='results'),
... | 31.230769 | 86 | 0.559113 |
from django.urls import path
from . import views
app_name = 'polls'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('<int:pk>/', views.DetailView.as_view(), name='detail'),
path('<int:pk>/results/', views.ResultsView.as_view(), name='results'),
... | true | true |
1c19057716f9126cf66cde72386dffe915f4ed58 | 1,180 | py | Python | html/team27/enrichment/q10_a/pre_measure.py | srinidhinandakumar/polar.usc.edu | 475d9d96aac952cd2998688ce7bbf01728fd657b | [
"Apache-2.0"
] | 18 | 2016-01-26T19:43:27.000Z | 2020-04-23T16:24:46.000Z | html/team27/enrichment/q10_a/pre_measure.py | srinidhinandakumar/polar.usc.edu | 475d9d96aac952cd2998688ce7bbf01728fd657b | [
"Apache-2.0"
] | 143 | 2016-02-02T19:19:46.000Z | 2018-03-25T15:09:34.000Z | html/team27/enrichment/q10_a/pre_measure.py | srinidhinandakumar/polar.usc.edu | 475d9d96aac952cd2998688ce7bbf01728fd657b | [
"Apache-2.0"
] | 57 | 2016-01-26T17:58:54.000Z | 2018-09-10T23:44:45.000Z | import json
name_list, min_list, aver_list, max_list = [], [], [], []
with open('GeneralMeasurementsInfo.out', 'r') as f:
# print f
dict_json = json.load(f)
# print dict_json
for item_name in dict_json:
name_list.append(item_name.encode('ascii', 'ignore'))
for item in dict_json[item_name]:
if item == "mi... | 25.652174 | 66 | 0.684746 | import json
name_list, min_list, aver_list, max_list = [], [], [], []
with open('GeneralMeasurementsInfo.out', 'r') as f:
dict_json = json.load(f)
for item_name in dict_json:
name_list.append(item_name.encode('ascii', 'ignore'))
for item in dict_json[item_name]:
if item == "min":
min_list.append(int(... | false | true |
1c1906e8e6b21927f917348ef837096f4648dda7 | 2,477 | py | Python | machine_learning/logistic_regression.py | czuo0303/Python | 4b71e2647b38f146e795a645957b311905c6c33f | [
"MIT"
] | 6 | 2020-06-23T11:56:55.000Z | 2021-10-03T17:21:34.000Z | machine_learning/logistic_regression.py | Jay9z/Python | c906ba82f3772173a7e90bd0918c846530439a8b | [
"MIT"
] | 3 | 2020-06-08T07:03:15.000Z | 2020-06-08T08:41:22.000Z | machine_learning/logistic_regression.py | Jay9z/Python | c906ba82f3772173a7e90bd0918c846530439a8b | [
"MIT"
] | 6 | 2020-05-31T20:40:50.000Z | 2021-12-23T04:52:15.000Z | #!/usr/bin/python
# Logistic Regression from scratch
# In[62]:
# In[63]:
# importing all the required libraries
"""
Implementing logistic regression for classification problem
Helpful resources:
Coursera ML course
https://medium.com/@martinpella/logistic-regression-from-scratch-in-python-124c5636b8ac
"""
import n... | 27.522222 | 87 | 0.626161 |
import numpy as np
import matplotlib.pyplot as plt
from sklearn import datasets
def sigmoid_function(z):
return 1 / (1 + np.exp(-z))
def cost_function(h, y):
return (-y * np.log(h) - (1 - y) * np.log(1 - h)).mean()
def log_likelihood(X, Y, weights):
scores = np.dot(X, weights)
return np... | true | true |
1c190821b8cecd689ec7b8bd372dc05afd4d46f8 | 1,738 | py | Python | optimus/outliers/z_score.py | atwoodjw/Optimus | 938463cec41a6683d2077c9afc7d6ba05c3b993f | [
"Apache-2.0"
] | null | null | null | optimus/outliers/z_score.py | atwoodjw/Optimus | 938463cec41a6683d2077c9afc7d6ba05c3b993f | [
"Apache-2.0"
] | null | null | null | optimus/outliers/z_score.py | atwoodjw/Optimus | 938463cec41a6683d2077c9afc7d6ba05c3b993f | [
"Apache-2.0"
] | null | null | null | from pyspark.sql import functions as F
from optimus.helpers.check import is_dataframe, is_numeric
from optimus.helpers.converter import one_list_to_val
from optimus.helpers.columns import parse_columns, name_col
class ZScore:
"""
Handle outliers using z Score
"""
def __init__(self, df, col_name, thr... | 28.032258 | 124 | 0.637514 | from pyspark.sql import functions as F
from optimus.helpers.check import is_dataframe, is_numeric
from optimus.helpers.converter import one_list_to_val
from optimus.helpers.columns import parse_columns, name_col
class ZScore:
def __init__(self, df, col_name, threshold):
if not is_dataframe(df):
... | true | true |
1c19084063ad715ee1979573aa9baa1655132eda | 2,519 | py | Python | tests/api_manager/test_relationship_api_generation.py | brighthive/data-resource-generator | 66154c5954ac287f2af25359b2abb0abb417b265 | [
"MIT"
] | 2 | 2020-06-12T13:43:42.000Z | 2020-06-28T00:25:40.000Z | tests/api_manager/test_relationship_api_generation.py | brighthive/data-resource-generator | 66154c5954ac287f2af25359b2abb0abb417b265 | [
"MIT"
] | 3 | 2020-07-01T00:17:48.000Z | 2020-09-21T21:16:39.000Z | tests/api_manager/test_relationship_api_generation.py | brighthive/data-resource-generator | 66154c5954ac287f2af25359b2abb0abb417b265 | [
"MIT"
] | null | null | null | from data_resource.generator.api_manager.api_generator import (
generate_relationship_rest_api_routes,
generate_relationship_based_routes,
generate_orm_relationship_list,
reverse_relationship_orm_list,
generate_relationship_rest_api_routes,
)
import pytest
from sqlalchemy.ext.declarative import decl... | 29.635294 | 88 | 0.739976 | from data_resource.generator.api_manager.api_generator import (
generate_relationship_rest_api_routes,
generate_relationship_based_routes,
generate_orm_relationship_list,
reverse_relationship_orm_list,
generate_relationship_rest_api_routes,
)
import pytest
from sqlalchemy.ext.declarative import decl... | true | true |
1c190904e07d55f82af839a87fdbebb320246262 | 3,299 | py | Python | bot.py | ananduks2016/transfer.sh-bot | 7d835a6b9061e44edf3dc5a180e551844d2cc103 | [
"MIT"
] | null | null | null | bot.py | ananduks2016/transfer.sh-bot | 7d835a6b9061e44edf3dc5a180e551844d2cc103 | [
"MIT"
] | null | null | null | bot.py | ananduks2016/transfer.sh-bot | 7d835a6b9061e44edf3dc5a180e551844d2cc103 | [
"MIT"
] | 2 | 2019-12-23T18:35:25.000Z | 2020-06-30T06:44:25.000Z | from telethon import TelegramClient, events
from download_from_url import download_file, get_size
import os
import time
import datetime
import aiohttp
api_id = int("API ID")
api_hash = "API HASH"
bot_token = "BOT TOKEN"
download_path = "Downloads/"
bot = TelegramClient('Uploader bot', api_id, api_hash).st... | 36.252747 | 130 | 0.622007 | from telethon import TelegramClient, events
from download_from_url import download_file, get_size
import os
import time
import datetime
import aiohttp
api_id = int("API ID")
api_hash = "API HASH"
bot_token = "BOT TOKEN"
download_path = "Downloads/"
bot = TelegramClient('Uploader bot', api_id, api_hash).st... | true | true |
1c19096ef3bd6a269ddfd0bcd963f3f1505fcf99 | 2,148 | py | Python | data_management/test/test_build_elevation/TestUtilities.py | conklinbd/solutions-geoprocessing-toolbox | 7afab793ea34b7e7cb7e32757e8a150b6637ffd2 | [
"Apache-2.0"
] | null | null | null | data_management/test/test_build_elevation/TestUtilities.py | conklinbd/solutions-geoprocessing-toolbox | 7afab793ea34b7e7cb7e32757e8a150b6637ffd2 | [
"Apache-2.0"
] | null | null | null | data_management/test/test_build_elevation/TestUtilities.py | conklinbd/solutions-geoprocessing-toolbox | 7afab793ea34b7e7cb7e32757e8a150b6637ffd2 | [
"Apache-2.0"
] | 1 | 2018-10-25T15:52:41.000Z | 2018-10-25T15:52:41.000Z | #------------------------------------------------------------------------------
# Copyright 2013 Esri
# 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/LICENS... | 38.357143 | 124 | 0.64851 |
import arcpy
import os
import sys
currentPath = os.path.dirname(__file__)
geodatabasePath = os.path.normpath(os.path.join(currentPath, r"../../../data_management/data/geodatabases/"))
scratchPath = geodatabasePath
toolboxesPath = os.path.normpath(os.path.join(currentPath, r"../../../data_management/toolboxes/"))
ele... | true | true |
1c19098049e95149cb7de0a5bb4d2266fe731e6d | 1,026 | py | Python | kimochiconsumer/views.py | matslindh/kimochi-consumer | 198162f32c656cfcbf9fcd064cdb2cc2c0e81c2f | [
"MIT"
] | null | null | null | kimochiconsumer/views.py | matslindh/kimochi-consumer | 198162f32c656cfcbf9fcd064cdb2cc2c0e81c2f | [
"MIT"
] | null | null | null | kimochiconsumer/views.py | matslindh/kimochi-consumer | 198162f32c656cfcbf9fcd064cdb2cc2c0e81c2f | [
"MIT"
] | null | null | null | from pyramid.view import view_config
from pyramid.httpexceptions import (
HTTPNotFound,
)
@view_config(route_name='page', renderer='templates/page.mako')
@view_config(route_name='page_view', renderer='templates/page.mako')
def page_view(request):
if 'page_id' in request.matchdict:
data = request.kimo... | 27.72973 | 104 | 0.730994 | from pyramid.view import view_config
from pyramid.httpexceptions import (
HTTPNotFound,
)
@view_config(route_name='page', renderer='templates/page.mako')
@view_config(route_name='page_view', renderer='templates/page.mako')
def page_view(request):
if 'page_id' in request.matchdict:
data = request.kimo... | true | true |
1c1909e9fef34b424ee3bdc557e7a719712f71e4 | 1,715 | py | Python | gwells/management/commands/creategroups.py | rstens/gwells | 234132f741643d2debd3c509c46c0bbfae2333ae | [
"Apache-2.0"
] | 1 | 2020-01-29T22:42:40.000Z | 2020-01-29T22:42:40.000Z | gwells/management/commands/creategroups.py | rstens/gwells | 234132f741643d2debd3c509c46c0bbfae2333ae | [
"Apache-2.0"
] | 1 | 2018-05-02T05:28:33.000Z | 2018-05-09T15:58:07.000Z | gwells/management/commands/creategroups.py | rstens/gwells | 234132f741643d2debd3c509c46c0bbfae2333ae | [
"Apache-2.0"
] | 1 | 2018-05-02T23:56:48.000Z | 2018-05-02T23:56:48.000Z | import os
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import Group
class Command(BaseCommand):
help = 'Creates a set of groups for GWELLS users'
def handle(self, *args, **options):
group_gwells_admin = Group.objects.get_or_create(name="gwells_admin... | 37.282609 | 108 | 0.564431 | import os
from django.core.management.base import BaseCommand, CommandError
from django.contrib.auth.models import Group
class Command(BaseCommand):
help = 'Creates a set of groups for GWELLS users'
def handle(self, *args, **options):
group_gwells_admin = Group.objects.get_or_create(name="gwells_admin... | true | true |
1c190b014817e3e342b1f7c7499b57041caf6842 | 14,242 | py | Python | pipenv/vendor/pythonfinder/utils.py | illgitthat/pipenv | 02fc63964052720a6804165d68f6075841627e09 | [
"MIT"
] | 3 | 2020-02-16T07:04:50.000Z | 2020-02-21T12:45:30.000Z | pipenv/vendor/pythonfinder/utils.py | whisperbb/pipenv | bfbe1304f63372a0eb7c1531590b51195db453ea | [
"MIT"
] | 1 | 2019-12-16T10:00:42.000Z | 2019-12-16T10:00:42.000Z | pipenv/vendor/pythonfinder/utils.py | whisperbb/pipenv | bfbe1304f63372a0eb7c1531590b51195db453ea | [
"MIT"
] | 1 | 2020-12-04T17:49:26.000Z | 2020-12-04T17:49:26.000Z | # -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function
import io
import itertools
import os
import re
from fnmatch import fnmatch
from threading import Timer
import attr
import six
import vistir
from packaging.version import LegacyVersion, Version
from .environment import MYPY_RUNNING, PYENV_R... | 32.368182 | 122 | 0.628212 | from __future__ import absolute_import, print_function
import io
import itertools
import os
import re
from fnmatch import fnmatch
from threading import Timer
import attr
import six
import vistir
from packaging.version import LegacyVersion, Version
from .environment import MYPY_RUNNING, PYENV_ROOT, SUBPROCESS_TIMEOUT... | true | true |
1c190b7ca85558df6c1f20b2183b3f44c3abcb3a | 7,328 | py | Python | gitissuebot/main.py | AustinSanders/gitissuebot | 89f50e15bb9bfb13b74b298b78ca5f1e1ca99383 | [
"CC0-1.0"
] | null | null | null | gitissuebot/main.py | AustinSanders/gitissuebot | 89f50e15bb9bfb13b74b298b78ca5f1e1ca99383 | [
"CC0-1.0"
] | null | null | null | gitissuebot/main.py | AustinSanders/gitissuebot | 89f50e15bb9bfb13b74b298b78ca5f1e1ca99383 | [
"CC0-1.0"
] | null | null | null | from datetime import datetime
import requests
from .settings import config
def run_query(query):
"""
Runs a GraphQL query against the GitHub API.
Parameters
----------
query : str
The GraphQL string query to be passed to the API
Returns
-------
: dict
The JSON (... | 29.312 | 154 | 0.557587 | from datetime import datetime
import requests
from .settings import config
def run_query(query):
headers = {"Authorization": f"Bearer {config['APIKEY']}"}
request = requests.post(config['git_url'], json={'query':query}, headers=headers, verify=config['ssl_cert'])
if request.status_code == 200:
ret... | true | true |
1c190c81cfd14178bc02ddb5888f34d5006b05f4 | 810 | py | Python | deepl.py | poliakustyczny/deepl.py | ea23de871824260834ed7ee73c4c168a605e70b5 | [
"MIT"
] | null | null | null | deepl.py | poliakustyczny/deepl.py | ea23de871824260834ed7ee73c4c168a605e70b5 | [
"MIT"
] | null | null | null | deepl.py | poliakustyczny/deepl.py | ea23de871824260834ed7ee73c4c168a605e70b5 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys, requests, json
URL = "https://www.deepl.com/jsonrpc"
def encodeRequest(text):
return(json.dumps({"jsonrpc" : "2.0", "method" : "LMT_handle_jobs", "params" : { "jobs" : [ { "kind" : "default", "raw_en_sentence" : text } ], "lang" : { "user_preferred_langs" : [ "EN", "PL"], "source_l... | 35.217391 | 303 | 0.648148 |
import sys, requests, json
URL = "https://www.deepl.com/jsonrpc"
def encodeRequest(text):
return(json.dumps({"jsonrpc" : "2.0", "method" : "LMT_handle_jobs", "params" : { "jobs" : [ { "kind" : "default", "raw_en_sentence" : text } ], "lang" : { "user_preferred_langs" : [ "EN", "PL"], "source_lang_user_selected" ... | true | true |
1c190dfa08f6525accd0da67a3c99100e4fcdc76 | 5,639 | py | Python | tuf/tests/system_tests/test_replay_attack.py | 0xdeadbeefJERKY/tuf | 9ff22ddd4e5d49f3d00d05a4a585cb1043fe7619 | [
"MIT"
] | null | null | null | tuf/tests/system_tests/test_replay_attack.py | 0xdeadbeefJERKY/tuf | 9ff22ddd4e5d49f3d00d05a4a585cb1043fe7619 | [
"MIT"
] | null | null | null | tuf/tests/system_tests/test_replay_attack.py | 0xdeadbeefJERKY/tuf | 9ff22ddd4e5d49f3d00d05a4a585cb1043fe7619 | [
"MIT"
] | 1 | 2021-05-15T16:36:18.000Z | 2021-05-15T16:36:18.000Z | """
<Program Name>
test_replay_attack.py
<Author>
Konstantin Andrianov
<Started>
February 22, 2012
<Copyright>
See LICENSE for licensing information.
<Purpose>
Simulate a replay attack. A simple client update vs. client update
implementing TUF.
In the replay attack an attacker is able to trick clie... | 30.15508 | 77 | 0.739138 | """
<Program Name>
test_replay_attack.py
<Author>
Konstantin Andrianov
<Started>
February 22, 2012
<Copyright>
See LICENSE for licensing information.
<Purpose>
Simulate a replay attack. A simple client update vs. client update
implementing TUF.
In the replay attack an attacker is able to trick clie... | false | true |
1c190e9bbc4f992ca8e327af81cadc014e12a164 | 1,767 | py | Python | edb/tools/docs/__init__.py | tailhook/edgedb | 655230a20a6b728fe18bfe36876bb4fb918bb4d8 | [
"Apache-2.0"
] | 7,302 | 2018-05-10T18:36:31.000Z | 2022-03-31T17:49:36.000Z | edb/tools/docs/__init__.py | tailhook/edgedb | 655230a20a6b728fe18bfe36876bb4fb918bb4d8 | [
"Apache-2.0"
] | 1,602 | 2018-05-10T17:45:38.000Z | 2022-03-31T23:46:19.000Z | edb/tools/docs/__init__.py | tailhook/edgedb | 655230a20a6b728fe18bfe36876bb4fb918bb4d8 | [
"Apache-2.0"
] | 236 | 2018-05-13T14:15:29.000Z | 2022-03-29T19:39:19.000Z | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2018-present MagicStack Inc. and the EdgeDB 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... | 29.949153 | 74 | 0.708546 |
from __future__ import annotations
from docutils import nodes as d_nodes
from sphinx import transforms as s_transforms
from . import cli
from . import eql
from . import js
from . import sdl
from . import graphql
from . import shared
class ProhibitedNodeTransform(s_transforms.SphinxTransform):
default_priorit... | true | true |
1c190f3328d228850e96eab4ade8576afab10cdf | 22,940 | py | Python | hum.py | chankisangrawal/sotc_graphics | c95bacd7199dcf0e33c8296d7cbad1ef2e9a72bd | [
"BSD-3-Clause"
] | 1 | 2020-12-09T09:30:08.000Z | 2020-12-09T09:30:08.000Z | hum.py | chankisangrawal/sotc_graphics | c95bacd7199dcf0e33c8296d7cbad1ef2e9a72bd | [
"BSD-3-Clause"
] | null | null | null | hum.py | chankisangrawal/sotc_graphics | c95bacd7199dcf0e33c8296d7cbad1ef2e9a72bd | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#************************************************************************
#
# Plot figures and output numbers for Surface Humidity (HUM) section.
# For BAMS SotC 2016
#
#************************************************************************
# SVN Info
# $Rev:: 28 ... | 48.601695 | 155 | 0.572276 | from __future__ import absolute_import
from __future__ import print_function
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import settings
import utils
DATALOC = "{}/{}/data/HUM/".format(settings.ROOTLOC, settings.YEAR)
LEGEND_LOC = 'upper left'
LW = 3
BBOX = (0, 0.9)
d... | true | true |
1c190f3973dd9a01e68eab3c1f48ce774d98433c | 1,449 | py | Python | .gitlab/validate-agent-build/trigger_agent_build.py | jejikenwogu/integrations-core | 26d90d6e73c135e3bc0c590ec195d459165dc89f | [
"BSD-3-Clause"
] | null | null | null | .gitlab/validate-agent-build/trigger_agent_build.py | jejikenwogu/integrations-core | 26d90d6e73c135e3bc0c590ec195d459165dc89f | [
"BSD-3-Clause"
] | null | null | null | .gitlab/validate-agent-build/trigger_agent_build.py | jejikenwogu/integrations-core | 26d90d6e73c135e3bc0c590ec195d459165dc89f | [
"BSD-3-Clause"
] | null | null | null | import requests
import os
import argparse
DATADOG_AGENT_PIPELINE_URL = os.environ['DATADOG_AGENT_PIPELINE_URL'].rstrip('/')
BASE_URL = os.environ['CI_API_V4_URL']
CI_TOKEN = os.environ['CI_JOB_TOKEN']
def trigger_pipeline():
# TODO: Opt out of kitchen tests when the appropriate flag is implemented.
data = {... | 33.697674 | 110 | 0.665286 | import requests
import os
import argparse
DATADOG_AGENT_PIPELINE_URL = os.environ['DATADOG_AGENT_PIPELINE_URL'].rstrip('/')
BASE_URL = os.environ['CI_API_V4_URL']
CI_TOKEN = os.environ['CI_JOB_TOKEN']
def trigger_pipeline():
data = {
"token": CI_TOKEN,
"ref": "master",
"variables": {... | true | true |
1c190f5a44334a8d4b8d6e8d7a70f9f233530d37 | 132 | py | Python | Package/urls.py | donorgrid/donorgrid | 4139df3ceaf767b9696aa4208e3721472f03592a | [
"MIT"
] | 8 | 2021-09-01T03:38:45.000Z | 2021-12-23T20:00:37.000Z | Package/urls.py | donorgrid/donorgrid | 4139df3ceaf767b9696aa4208e3721472f03592a | [
"MIT"
] | 41 | 2021-10-22T03:16:50.000Z | 2022-03-28T03:13:24.000Z | Package/urls.py | raunakhajela/DonorGrid | 5218951d395bae9fd722835634a1998a6015d756 | [
"MIT"
] | 4 | 2021-08-13T15:05:41.000Z | 2022-01-03T09:40:19.000Z | from django.urls import path
from .views import get_all
app_name = 'package'
urlpatterns = [
path('', get_all, name='all'),
]
| 14.666667 | 34 | 0.681818 | from django.urls import path
from .views import get_all
app_name = 'package'
urlpatterns = [
path('', get_all, name='all'),
]
| true | true |
1c190f831fc60580cf3fe1fabd7b6c32f779c3dc | 6,625 | py | Python | cimcb_lite/utils/univariate_2class.py | RuibingS/cimcb | 382f7d8fff30d3d276f18ac8c7dc686e0e643fa9 | [
"MIT"
] | 3 | 2019-05-19T10:36:50.000Z | 2020-10-12T08:13:04.000Z | cimcb_lite/utils/univariate_2class.py | RuibingS/cimcb | 382f7d8fff30d3d276f18ac8c7dc686e0e643fa9 | [
"MIT"
] | 1 | 2021-06-29T13:38:18.000Z | 2021-06-29T13:38:18.000Z | cimcb_lite/utils/univariate_2class.py | RuibingS/cimcb | 382f7d8fff30d3d276f18ac8c7dc686e0e643fa9 | [
"MIT"
] | 3 | 2019-05-19T10:37:03.000Z | 2020-10-12T08:13:05.000Z | import numpy as np
import pandas as pd
import scipy.stats
from statsmodels.stats.multitest import multipletests
from .table_check import table_check
def univariate_2class(DataTable, PeakTable, group, posclass, parametric=True, seed=None):
"""Creates a table of univariate statistics (2 class).
Parameters
... | 40.644172 | 188 | 0.622943 | import numpy as np
import pandas as pd
import scipy.stats
from statsmodels.stats.multitest import multipletests
from .table_check import table_check
def univariate_2class(DataTable, PeakTable, group, posclass, parametric=True, seed=None):
table_check(DataTable, PeakTable, print_statement=False)
if group ... | true | true |
1c191019c045f46b5a1ee4d832e27107c7a0c98a | 5,981 | py | Python | homeassistant/components/nam/const.py | mikan-megane/core | 837220cce40890e296920d33a623adbc11bd15a6 | [
"Apache-2.0"
] | 5 | 2018-10-23T14:15:05.000Z | 2021-11-26T06:38:44.000Z | homeassistant/components/nam/const.py | mikan-megane/core | 837220cce40890e296920d33a623adbc11bd15a6 | [
"Apache-2.0"
] | 79 | 2020-07-23T07:13:37.000Z | 2022-03-22T06:02:37.000Z | homeassistant/components/nam/const.py | mikan-megane/core | 837220cce40890e296920d33a623adbc11bd15a6 | [
"Apache-2.0"
] | 2 | 2019-06-11T12:13:14.000Z | 2020-12-24T23:17:53.000Z | """Constants for Nettigo Air Monitor integration."""
from __future__ import annotations
from datetime import timedelta
from typing import Final
from homeassistant.components.sensor import ATTR_STATE_CLASS, STATE_CLASS_MEASUREMENT
from homeassistant.const import (
ATTR_DEVICE_CLASS,
ATTR_ICON,
CONCENTRATIO... | 33.601124 | 85 | 0.702558 | from __future__ import annotations
from datetime import timedelta
from typing import Final
from homeassistant.components.sensor import ATTR_STATE_CLASS, STATE_CLASS_MEASUREMENT
from homeassistant.const import (
ATTR_DEVICE_CLASS,
ATTR_ICON,
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
DEVICE_CLASS_HUMIDI... | true | true |
1c1910c77ecd28e0ba1310d4a369590b9b9125b1 | 199 | py | Python | Python/CodeForces Solutions/501-1000/580A.py | 7namansharma/Comp-Prog | b760ef9b4173e6d5851dc63cc92a8e935baf60ed | [
"MIT"
] | null | null | null | Python/CodeForces Solutions/501-1000/580A.py | 7namansharma/Comp-Prog | b760ef9b4173e6d5851dc63cc92a8e935baf60ed | [
"MIT"
] | null | null | null | Python/CodeForces Solutions/501-1000/580A.py | 7namansharma/Comp-Prog | b760ef9b4173e6d5851dc63cc92a8e935baf60ed | [
"MIT"
] | null | null | null | n = int(input())
l = list(map(int, input().split()))
k = 1
maxi = 0
for i in range(1, n):
if l[i] >= l[i-1]:
k += 1
else:
maxi = max(maxi, k)
k = 1
print(max(maxi, k)) | 18.090909 | 35 | 0.452261 | n = int(input())
l = list(map(int, input().split()))
k = 1
maxi = 0
for i in range(1, n):
if l[i] >= l[i-1]:
k += 1
else:
maxi = max(maxi, k)
k = 1
print(max(maxi, k)) | true | true |
1c1910da3d8a9b5860c37a587f62468f288d1ee6 | 4,642 | py | Python | basic/practice_1/randomwalk.py | link-kut/e_learning_rl | d35a359c84994268531429b51b8c78577b284f9c | [
"MIT"
] | null | null | null | basic/practice_1/randomwalk.py | link-kut/e_learning_rl | d35a359c84994268531429b51b8c78577b284f9c | [
"MIT"
] | 8 | 2020-11-13T18:59:22.000Z | 2022-03-12T00:41:04.000Z | basic/practice_1/randomwalk.py | link-kut/e_learning_rl | d35a359c84994268531429b51b8c78577b284f9c | [
"MIT"
] | 1 | 2021-09-07T12:41:33.000Z | 2021-09-07T12:41:33.000Z | import time
import gym
# -------------------------------
# T1 0 1 2 3 4 T2
# -------------------------------
class RandomWalk(gym.Env):
def __init__(
self,
num_internal_states=5, # 종료 상태를 제외한 내부 상태 개수
transition_reward=0.0, # 일반적인 상태 전이 보상
left_ter... | 29.75641 | 113 | 0.580784 | import time
import gym
class RandomWalk(gym.Env):
def __init__(
self,
num_internal_states=5, transition_reward=0.0, left_terminal_reward=0.0, right_terminal_reward=1.0 ):
self.__version__ = "0.0.1"
self.nu... | true | true |
1c191229de79efad4bbfb574c86b66ceeea80bc2 | 4,507 | bzl | Python | bazel/google_cloud_cpp_pubsub_deps.bzl | renovate-bot/google-cloud-cpp-pubsub | 42f1ec6f6641767cab8344ece1c7c563b89ea835 | [
"Apache-2.0"
] | null | null | null | bazel/google_cloud_cpp_pubsub_deps.bzl | renovate-bot/google-cloud-cpp-pubsub | 42f1ec6f6641767cab8344ece1c7c563b89ea835 | [
"Apache-2.0"
] | null | null | null | bazel/google_cloud_cpp_pubsub_deps.bzl | renovate-bot/google-cloud-cpp-pubsub | 42f1ec6f6641767cab8344ece1c7c563b89ea835 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 41.731481 | 115 | 0.670069 |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
def google_cloud_cpp_pubsub_deps():
if "rules_cc" not in native.existing_rules():
http_archive(
name = "rules_cc",
strip_prefix = "rules_cc-a508235df92e71d537fcbae0c7c952ea6957a912",
... | true | true |
1c19123eafbd3f87607152053ec237be597e6c36 | 513 | py | Python | unit_tests/helpers.py | TheFloe1995/correct-pose | 90c3c46ca50b07526a4df36645fa71572255a950 | [
"MIT"
] | 4 | 2019-12-25T08:29:31.000Z | 2022-02-18T07:19:23.000Z | unit_tests/helpers.py | TheFloe1995/correct-pose | 90c3c46ca50b07526a4df36645fa71572255a950 | [
"MIT"
] | null | null | null | unit_tests/helpers.py | TheFloe1995/correct-pose | 90c3c46ca50b07526a4df36645fa71572255a950 | [
"MIT"
] | null | null | null | import torch.nn as nn
class DummyLoss(nn.Module):
def forward(self, predictions, labels):
return predictions.sum()
class DummyModel(nn.Module):
def __init__(self):
super(DummyModel, self).__init__()
self.net = nn.Linear(63, 63)
def forward(self, pose_batch):
return self.... | 22.304348 | 70 | 0.643275 | import torch.nn as nn
class DummyLoss(nn.Module):
def forward(self, predictions, labels):
return predictions.sum()
class DummyModel(nn.Module):
def __init__(self):
super(DummyModel, self).__init__()
self.net = nn.Linear(63, 63)
def forward(self, pose_batch):
return self.... | true | true |
1c191312b91475b5a5523b2ce7e479e18282b490 | 32,162 | py | Python | RL/gym-cdtn/gym_cdtn/envs/cdtn_continuous_priorities_hybrid.py | seakers/dtnsim | 9ea1da84e0565d97b3ea184facb597302bf4d99e | [
"Apache-2.0"
] | null | null | null | RL/gym-cdtn/gym_cdtn/envs/cdtn_continuous_priorities_hybrid.py | seakers/dtnsim | 9ea1da84e0565d97b3ea184facb597302bf4d99e | [
"Apache-2.0"
] | null | null | null | RL/gym-cdtn/gym_cdtn/envs/cdtn_continuous_priorities_hybrid.py | seakers/dtnsim | 9ea1da84e0565d97b3ea184facb597302bf4d99e | [
"Apache-2.0"
] | null | null | null | import gym
import numpy as np
from collections import deque
from collections import defaultdict
import pandas as pd
import random
from RL_utils import check_node_memory
from gym import error, spaces, utils
from bin.main import load_configuration_file, parse_configuration_dict
from simulator.environments.DtnSimEnvironm... | 56.923894 | 119 | 0.654188 | import gym
import numpy as np
from collections import deque
from collections import defaultdict
import pandas as pd
import random
from RL_utils import check_node_memory
from gym import error, spaces, utils
from bin.main import load_configuration_file, parse_configuration_dict
from simulator.environments.DtnSimEnvironm... | true | true |
1c1913b2f03681c91babcedba8cea29c10acb648 | 2,739 | py | Python | drf_spectacular/management/commands/spectacular.py | Mopsan/drf-spectacular | 5d1280c29994793be517b443fd5d902525c6ab3e | [
"BSD-3-Clause"
] | null | null | null | drf_spectacular/management/commands/spectacular.py | Mopsan/drf-spectacular | 5d1280c29994793be517b443fd5d902525c6ab3e | [
"BSD-3-Clause"
] | null | null | null | drf_spectacular/management/commands/spectacular.py | Mopsan/drf-spectacular | 5d1280c29994793be517b443fd5d902525c6ab3e | [
"BSD-3-Clause"
] | null | null | null | from textwrap import dedent
from django.core.management.base import BaseCommand
from django.utils.module_loading import import_string
from rest_framework import renderers
from drf_spectacular.settings import spectacular_settings
from drf_spectacular.plumbing import GENERATOR_STATS
from drf_spectacular.renderers impor... | 42.138462 | 120 | 0.687477 | from textwrap import dedent
from django.core.management.base import BaseCommand
from django.utils.module_loading import import_string
from rest_framework import renderers
from drf_spectacular.settings import spectacular_settings
from drf_spectacular.plumbing import GENERATOR_STATS
from drf_spectacular.renderers impor... | true | true |
1c19151396d97659a0cffa1ac1c305f88e7957bb | 9,857 | py | Python | api/geocodr/search.py | axza/geocodr | 5a60d7ace537c76cb41b5ca4f31d3dee6a8bf5ce | [
"Apache-2.0"
] | 3 | 2018-10-17T13:29:27.000Z | 2020-10-10T09:47:29.000Z | api/geocodr/search.py | axza/geocodr | 5a60d7ace537c76cb41b5ca4f31d3dee6a8bf5ce | [
"Apache-2.0"
] | 2 | 2022-03-22T06:42:50.000Z | 2022-03-22T06:42:56.000Z | api/geocodr/search.py | axza/geocodr | 5a60d7ace537c76cb41b5ca4f31d3dee6a8bf5ce | [
"Apache-2.0"
] | 1 | 2020-11-02T12:54:57.000Z | 2020-11-02T12:54:57.000Z | # -:- encoding: utf-8 -:-
"""
The search module provides classes for custom Collections and Fields.
"""
import re
import json
import shapely.geometry
import shapely.wkt
from geocodr import proj
from geocodr.lib.geom import point_on_geom
class Collection(object):
name = ''
title = 'Unknown collection'
... | 28.737609 | 89 | 0.555138 |
import re
import json
import shapely.geometry
import shapely.wkt
from geocodr import proj
from geocodr.lib.geom import point_on_geom
class Collection(object):
name = ''
title = 'Unknown collection'
class_ = 'unknown_class'
class_title = 'Unknown class'
jsonblob_field = 'json'
fields = ()... | true | true |
1c191762020232a0f91c0417b94f77f4785ab046 | 18,020 | py | Python | examples/tiago_pnp/execution_nodes.py | dgerod/behavior_tree_learning | 71da80c91ecd48fd5da377f83604b62112ba9629 | [
"Apache-2.0"
] | 7 | 2022-02-09T12:51:51.000Z | 2022-03-19T14:40:16.000Z | examples/tiago_pnp/execution_nodes.py | dgerod/bt_learning_using_gp | ac1fb6ba4dbd6d18b5d002c7ad2647771f8b0fb9 | [
"Apache-2.0"
] | 6 | 2021-12-12T15:38:40.000Z | 2022-01-31T11:02:12.000Z | examples/tiago_pnp/execution_nodes.py | dgerod/bt_learning_using_gp | ac1fb6ba4dbd6d18b5d002c7ad2647771f8b0fb9 | [
"Apache-2.0"
] | null | null | null | import re
import py_trees as pt
from behavior_tree_learning.sbt import BehaviorRegister, BehaviorNode
from tiago_pnp import world as sm
class BlockOnTable(BehaviorNode):
"""
Condition checking if the cube is on table
"""
@staticmethod
def make(text, world, verbose=False):
return BlockOnTa... | 30.387858 | 103 | 0.620477 | import re
import py_trees as pt
from behavior_tree_learning.sbt import BehaviorRegister, BehaviorNode
from tiago_pnp import world as sm
class BlockOnTable(BehaviorNode):
@staticmethod
def make(text, world, verbose=False):
return BlockOnTable(text, world)
def __init__(self, name, world):
... | true | true |
1c1918488e022aab5948169e0feefa2948af6227 | 80,557 | py | Python | salt/master.py | kstaken/salt | 3321d57cf4d085bc6cbe269dbd01afd04fc6ff2a | [
"Apache-2.0"
] | null | null | null | salt/master.py | kstaken/salt | 3321d57cf4d085bc6cbe269dbd01afd04fc6ff2a | [
"Apache-2.0"
] | null | null | null | salt/master.py | kstaken/salt | 3321d57cf4d085bc6cbe269dbd01afd04fc6ff2a | [
"Apache-2.0"
] | 1 | 2020-03-07T07:04:55.000Z | 2020-03-07T07:04:55.000Z | '''
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
'''
# Import python libs
import os
import re
import time
import errno
import fnmatch
import signal
import shutil
import stat
import logging
import hashlib
imp... | 37.643458 | 194 | 0.504314 | '''
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
'''
import os
import re
import time
import errno
import fnmatch
import signal
import shutil
import stat
import logging
import hashlib
import datetime
try:
... | false | true |
1c19192f32740c9980d94d6419f33dd1a1539117 | 811 | py | Python | chapter6/exercise6_9.py | boldyshev/sutton | 6155f13491a859283ebb2154c978b2727a4c27af | [
"MIT"
] | null | null | null | chapter6/exercise6_9.py | boldyshev/sutton | 6155f13491a859283ebb2154c978b2727a4c27af | [
"MIT"
] | null | null | null | chapter6/exercise6_9.py | boldyshev/sutton | 6155f13491a859283ebb2154c978b2727a4c27af | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""Exercise 6.9, page 130"""
import numpy as np
import matplotlib.pyplot as plt
from example6_5 import WindyGridworld, sarsa_windy
def plot_time_episodes(world_type, actions):
dim = 10, 7
start = 0, 3
goal = 7, 3
state_action_dim = *dim, len(actions)
world = world_type(di... | 23.852941 | 84 | 0.630086 |
import numpy as np
import matplotlib.pyplot as plt
from example6_5 import WindyGridworld, sarsa_windy
def plot_time_episodes(world_type, actions):
dim = 10, 7
start = 0, 3
goal = 7, 3
state_action_dim = *dim, len(actions)
world = world_type(dim, actions, start, goal)
q = np.zeros(state_acti... | true | true |
1c1919664601152f2a033fa026731d6c9c0a0502 | 2,395 | py | Python | web/api/performance/core/corestats.py | ff-mish/porsche_lemans | 26fc80b77b44d8e0ec756d67c37112e56ca60bf9 | [
"MIT"
] | null | null | null | web/api/performance/core/corestats.py | ff-mish/porsche_lemans | 26fc80b77b44d8e0ec756d67c37112e56ca60bf9 | [
"MIT"
] | null | null | null | web/api/performance/core/corestats.py | ff-mish/porsche_lemans | 26fc80b77b44d8e0ec756d67c37112e56ca60bf9 | [
"MIT"
] | null | null | null | #
# Copyright (c) 2007-2009 Corey Goldberg (corey@goldb.org)
# License: GNU GPLv3
#
# This file is part of Pylot.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, ... | 26.910112 | 86 | 0.510647 |
import sys
class Stats:
def __init__(self, sequence):
self.sequence = [float(item) for item in sequence]
def sum(self):
if len(self.sequence) < 1:
return None
else:
return sum(self.sequence)
d... | false | true |
1c1919f16ba568b63953ee4594881b76123c7f77 | 84 | py | Python | src/chapter2/exercise2.py | group3BSE1/BSE-2021 | c3d04df5afb97a742858d72e0699a65de072f26f | [
"MIT"
] | null | null | null | src/chapter2/exercise2.py | group3BSE1/BSE-2021 | c3d04df5afb97a742858d72e0699a65de072f26f | [
"MIT"
] | null | null | null | src/chapter2/exercise2.py | group3BSE1/BSE-2021 | c3d04df5afb97a742858d72e0699a65de072f26f | [
"MIT"
] | 1 | 2021-04-09T09:26:27.000Z | 2021-04-09T09:26:27.000Z | name = input(" Enter your name:")
print('Hello ' + name)
# copyright of group3BSE1 | 28 | 34 | 0.678571 | name = input(" Enter your name:")
print('Hello ' + name)
| true | true |
1c191af48834149bec23b4bb3461f031f3659e9c | 824 | py | Python | tinkoff/investments/model/market/orderbook.py | zcoder/tinkoff-api | 362f73a64e16fa4da87e7f1a59d290037108252d | [
"Apache-2.0"
] | null | null | null | tinkoff/investments/model/market/orderbook.py | zcoder/tinkoff-api | 362f73a64e16fa4da87e7f1a59d290037108252d | [
"Apache-2.0"
] | null | null | null | tinkoff/investments/model/market/orderbook.py | zcoder/tinkoff-api | 362f73a64e16fa4da87e7f1a59d290037108252d | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from typing import List, Optional
from enum import Enum
from tinkoff.investments.model.base import BaseModel, FigiName
class TradingStatus(Enum):
NORMAL_TRADING = 'NormalTrading'
NOT_AVAILABLE_FOR_TRADING = 'NotAvailableForTrading'
@dataclass
class OrderBookEntity(BaseMode... | 21.128205 | 62 | 0.730583 | from dataclasses import dataclass
from typing import List, Optional
from enum import Enum
from tinkoff.investments.model.base import BaseModel, FigiName
class TradingStatus(Enum):
NORMAL_TRADING = 'NormalTrading'
NOT_AVAILABLE_FOR_TRADING = 'NotAvailableForTrading'
@dataclass
class OrderBookEntity(BaseMode... | true | true |
1c191b24b328b97c81c07dbb71a96255bb651f54 | 14,273 | py | Python | glance/db/models.py | Quinton/glance | 7674bc8963a3bec21f719c48f40e8a3fc0846e6f | [
"Apache-2.0"
] | 5 | 2017-04-23T05:50:36.000Z | 2019-03-12T09:45:20.000Z | glance/db/models.py | Quinton/glance | 7674bc8963a3bec21f719c48f40e8a3fc0846e6f | [
"Apache-2.0"
] | null | null | null | glance/db/models.py | Quinton/glance | 7674bc8963a3bec21f719c48f40e8a3fc0846e6f | [
"Apache-2.0"
] | 2 | 2018-08-16T11:41:18.000Z | 2018-10-21T06:56:50.000Z | #!/usr/bin/env python
#encode=utf-8
#vim: tabstop=4 shiftwidth=4 softtabstop=4
#Created on 2013-8-19
#Copyright 2013 nuoqingyun xuqifeng
from datetime import datetime
import calendar
import random
import string
import uuid
from oslo.config import cfg
from glance.db.basemodel import BaseModel
from glance.db.js import ... | 34.392771 | 119 | 0.594199 |
from datetime import datetime
import calendar
import random
import string
import uuid
from oslo.config import cfg
from glance.db.basemodel import BaseModel
from glance.db.js import traffic_map_test, traffic_reduce_test
from glance.utils import timeutils
from glance import log as logging
LOG = logging.getLogger(__nam... | false | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.