hexsha string | size int64 | ext string | lang string | max_stars_repo_path string | max_stars_repo_name string | max_stars_repo_head_hexsha string | max_stars_repo_licenses list | max_stars_count int64 | max_stars_repo_stars_event_min_datetime string | max_stars_repo_stars_event_max_datetime string | max_issues_repo_path string | max_issues_repo_name string | max_issues_repo_head_hexsha string | max_issues_repo_licenses list | max_issues_count int64 | max_issues_repo_issues_event_min_datetime string | max_issues_repo_issues_event_max_datetime string | max_forks_repo_path string | max_forks_repo_name string | max_forks_repo_head_hexsha string | max_forks_repo_licenses list | max_forks_count int64 | max_forks_repo_forks_event_min_datetime string | max_forks_repo_forks_event_max_datetime string | content string | avg_line_length float64 | max_line_length int64 | alphanum_fraction float64 | qsc_code_num_words_quality_signal int64 | qsc_code_num_chars_quality_signal float64 | qsc_code_mean_word_length_quality_signal float64 | qsc_code_frac_words_unique_quality_signal float64 | qsc_code_frac_chars_top_2grams_quality_signal float64 | qsc_code_frac_chars_top_3grams_quality_signal float64 | qsc_code_frac_chars_top_4grams_quality_signal float64 | qsc_code_frac_chars_dupe_5grams_quality_signal float64 | qsc_code_frac_chars_dupe_6grams_quality_signal float64 | qsc_code_frac_chars_dupe_7grams_quality_signal float64 | qsc_code_frac_chars_dupe_8grams_quality_signal float64 | qsc_code_frac_chars_dupe_9grams_quality_signal float64 | qsc_code_frac_chars_dupe_10grams_quality_signal float64 | qsc_code_frac_chars_replacement_symbols_quality_signal float64 | qsc_code_frac_chars_digital_quality_signal float64 | qsc_code_frac_chars_whitespace_quality_signal float64 | qsc_code_size_file_byte_quality_signal float64 | qsc_code_num_lines_quality_signal float64 | qsc_code_num_chars_line_max_quality_signal float64 | qsc_code_num_chars_line_mean_quality_signal float64 | qsc_code_frac_chars_alphabet_quality_signal float64 | qsc_code_frac_chars_comments_quality_signal float64 | qsc_code_cate_xml_start_quality_signal float64 | qsc_code_frac_lines_dupe_lines_quality_signal float64 | qsc_code_cate_autogen_quality_signal float64 | qsc_code_frac_lines_long_string_quality_signal float64 | qsc_code_frac_chars_string_length_quality_signal float64 | qsc_code_frac_chars_long_word_length_quality_signal float64 | qsc_code_frac_lines_string_concat_quality_signal float64 | qsc_code_cate_encoded_data_quality_signal float64 | qsc_code_frac_chars_hex_words_quality_signal float64 | qsc_code_frac_lines_prompt_comments_quality_signal float64 | qsc_code_frac_lines_assert_quality_signal float64 | qsc_codepython_cate_ast_quality_signal float64 | qsc_codepython_frac_lines_func_ratio_quality_signal float64 | qsc_codepython_cate_var_zero_quality_signal bool | qsc_codepython_frac_lines_pass_quality_signal float64 | qsc_codepython_frac_lines_import_quality_signal float64 | qsc_codepython_frac_lines_simplefunc_quality_signal float64 | qsc_codepython_score_lines_no_logic_quality_signal float64 | qsc_codepython_frac_lines_print_quality_signal float64 | qsc_code_num_words int64 | qsc_code_num_chars int64 | qsc_code_mean_word_length int64 | qsc_code_frac_words_unique null | qsc_code_frac_chars_top_2grams int64 | qsc_code_frac_chars_top_3grams int64 | qsc_code_frac_chars_top_4grams int64 | qsc_code_frac_chars_dupe_5grams int64 | qsc_code_frac_chars_dupe_6grams int64 | qsc_code_frac_chars_dupe_7grams int64 | qsc_code_frac_chars_dupe_8grams int64 | qsc_code_frac_chars_dupe_9grams int64 | qsc_code_frac_chars_dupe_10grams int64 | qsc_code_frac_chars_replacement_symbols int64 | qsc_code_frac_chars_digital int64 | qsc_code_frac_chars_whitespace int64 | qsc_code_size_file_byte int64 | qsc_code_num_lines int64 | qsc_code_num_chars_line_max int64 | qsc_code_num_chars_line_mean int64 | qsc_code_frac_chars_alphabet int64 | qsc_code_frac_chars_comments int64 | qsc_code_cate_xml_start int64 | qsc_code_frac_lines_dupe_lines int64 | qsc_code_cate_autogen int64 | qsc_code_frac_lines_long_string int64 | qsc_code_frac_chars_string_length int64 | qsc_code_frac_chars_long_word_length int64 | qsc_code_frac_lines_string_concat null | qsc_code_cate_encoded_data int64 | qsc_code_frac_chars_hex_words int64 | qsc_code_frac_lines_prompt_comments int64 | qsc_code_frac_lines_assert int64 | qsc_codepython_cate_ast int64 | qsc_codepython_frac_lines_func_ratio int64 | qsc_codepython_cate_var_zero int64 | qsc_codepython_frac_lines_pass int64 | qsc_codepython_frac_lines_import int64 | qsc_codepython_frac_lines_simplefunc int64 | qsc_codepython_score_lines_no_logic int64 | qsc_codepython_frac_lines_print int64 | effective string | hits int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
efb95e066c49cf0f6df78f28b7af1cd8f91e5b5b | 1,623 | py | Python | google/cloud/asset_v1beta1/gapic/enums.py | vam-google/python-asset | dbf236ecd633a5fa5dd2371493425ef0adfcc266 | [
"Apache-2.0"
] | null | null | null | google/cloud/asset_v1beta1/gapic/enums.py | vam-google/python-asset | dbf236ecd633a5fa5dd2371493425ef0adfcc266 | [
"Apache-2.0"
] | null | null | null | google/cloud/asset_v1beta1/gapic/enums.py | vam-google/python-asset | dbf236ecd633a5fa5dd2371493425ef0adfcc266 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Wrappers for protocol buffer enum types."""
import enum
class ContentType(enum.IntEnum):
"""
Asset content type.
Attributes:
CONTENT_TYPE_UNSPECIFIED (int): Unspecified content type.
RESOURCE (int): Resource metadata.
IAM_POLICY (int): The actual IAM policy set on a resource.
"""
CONTENT_TYPE_UNSPECIFIED = 0
RESOURCE = 1
IAM_POLICY = 2
class NullValue(enum.IntEnum):
"""
The resource type. It must be in the format of
{service_name}/{resource_type_kind}. The ``resource_type_kind`` must be
singular and must not include version numbers.
Example: ``storage.googleapis.com/Bucket``
The value of the resource_type_kind must follow the regular expression
/[A-Za-z][a-zA-Z0-9]+/. It should start with an upper case character and
should use PascalCase (UpperCamelCase). The maximum number of characters
allowed for the ``resource_type_kind`` is 100.
Attributes:
NULL_VALUE (int): Null value.
"""
NULL_VALUE = 0
| 29.509091 | 76 | 0.710413 | 231 | 1,623 | 4.917749 | 0.536797 | 0.052817 | 0.052817 | 0.050176 | 0.040493 | 0 | 0 | 0 | 0 | 0 | 0 | 0.013943 | 0.204559 | 1,623 | 54 | 77 | 30.055556 | 0.865995 | 0.815157 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
efbacac7bc1fdc4a93be492371e72cc0ae2a785c | 338 | py | Python | past_archive/swexpert/3304(logestCommonSequence).py | DongHyunByun/algorithm_practice | c726c69d35306d23467f4af6e10f2db6fdc68234 | [
"MIT"
] | null | null | null | past_archive/swexpert/3304(logestCommonSequence).py | DongHyunByun/algorithm_practice | c726c69d35306d23467f4af6e10f2db6fdc68234 | [
"MIT"
] | null | null | null | past_archive/swexpert/3304(logestCommonSequence).py | DongHyunByun/algorithm_practice | c726c69d35306d23467f4af6e10f2db6fdc68234 | [
"MIT"
] | null | null | null | for t in range(int(input())):
A,B=input().split()
L=[[0]*(len(A)+1) for i in range((len(B)+1))]
for i in range(len(B)):
for j in range(len(A)):
if B[i]==A[j]:
L[i+1][j+1]=L[i][j]+1
else :
L[i+1][j+1]=max(L[i][j+1],L[i+1][j])
print(f"#{t+1} {max(max(L))}")
| 28.166667 | 52 | 0.39645 | 70 | 338 | 1.914286 | 0.285714 | 0.074627 | 0.223881 | 0.089552 | 0.313433 | 0.238806 | 0.238806 | 0 | 0 | 0 | 0 | 0.047826 | 0.319527 | 338 | 11 | 53 | 30.727273 | 0.534783 | 0 | 0 | 0 | 0 | 0 | 0.059347 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.1 | 0 | 0 | 1 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
efbd3379408a5e04ee3e80643b141716af5132b6 | 2,249 | py | Python | creational/abstract_factory.py | kimgea/design_patterns | def656f50c4f26e25f8a0d2920041c2f002dc2d0 | [
"MIT"
] | null | null | null | creational/abstract_factory.py | kimgea/design_patterns | def656f50c4f26e25f8a0d2920041c2f002dc2d0 | [
"MIT"
] | null | null | null | creational/abstract_factory.py | kimgea/design_patterns | def656f50c4f26e25f8a0d2920041c2f002dc2d0 | [
"MIT"
] | null | null | null |
from abc import ABCMeta, abstractmethod
###########################
#
# Product
####
#Abstract Product
class AbstractShape(object):
__metaclass__ = ABCMeta
@abstractmethod
def draw(self):
pass
class AbstractColor(object):
__metaclass__ = ABCMeta
@abstractmethod
def fill(self):
pass
#Concreat Product
class Rectangle(AbstractShape):
def draw(self):
print ("Rectangle draw() method")
class Square(AbstractShape):
def draw(self):
print ("Square draw() method")
class Read(AbstractColor):
def fill(self):
print ("Read fill")
class Blue(AbstractColor):
def fill(self):
print ("Blue fill")
###########################
#
# Factory
####
#Abstract Factory
class AbstractFactory(object):
__metaclass__ = ABCMeta
@abstractmethod
def getShape(self):
pass
@abstractmethod
def getColor(self):
pass
#Concreat Factory
class ShapeFactory(AbstractFactory):
def getShape(self, shapetype):
try:
if shapetype.lower() == "rectangle":
return Rectangle()
elif shapetype.lower() == "square":
return Square()
except: pass
raise TypeError('Unknown Shape.')
def getColor(self, colortype):
return None
class ColorFactory(object):
def getShape(self, shapetype):
return None
def getColor(self, colortype):
try:
if colortype.lower() == "read":
return Rectangle()
elif colortype.lower() == "blue":
return Square()
except: pass #Bad exception
raise TypeError('Unknown Color.')
#Factory Producer
class FactoryProducer():
@staticmethod
def getFactory(factory_name):
try:
if factory_name.lower() == "shape":
return ShapeFactory()
elif factory_name.lower() == "color":
return ColorFactory()
except:pass #Bad exception
raise TypeError('Unknown Factory.')
shape_factory = FactoryProducer.getFactory("shape")
circle = shape_factory.getShape("square")
circle.draw()
| 20.261261 | 51 | 0.568697 | 198 | 2,249 | 6.373737 | 0.262626 | 0.066561 | 0.052298 | 0.085578 | 0.252773 | 0.068146 | 0.068146 | 0 | 0 | 0 | 0 | 0 | 0.310805 | 2,249 | 110 | 52 | 20.445455 | 0.814194 | 0.055136 | 0 | 0.5 | 0 | 0 | 0.072896 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.19697 | false | 0.106061 | 0.015152 | 0.030303 | 0.530303 | 0.060606 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
efc003916d2c366e77fcdb754cdf5df492201bf1 | 381 | py | Python | tests/models/cache.py | einsfr/commontail | a7421b7aac89dead7e4f7e0da0dff317157c3fea | [
"MIT"
] | null | null | null | tests/models/cache.py | einsfr/commontail | a7421b7aac89dead7e4f7e0da0dff317157c3fea | [
"MIT"
] | null | null | null | tests/models/cache.py | einsfr/commontail | a7421b7aac89dead7e4f7e0da0dff317157c3fea | [
"MIT"
] | null | null | null | from django.db import models
from commontail.models import AbstractCacheAware, CacheSuffixMeta
__all__ = ['CacheAwareModel', ]
class CacheAwareModel(AbstractCacheAware, models.Model):
cache_suffixes = AbstractCacheAware.cache_suffixes + {
'test': CacheSuffixMeta('default', 300),
}
def get_cache_prefix(self) -> str:
return f'testmodel{self.pk}'
| 22.411765 | 65 | 0.727034 | 38 | 381 | 7.078947 | 0.684211 | 0.096654 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.009524 | 0.173228 | 381 | 16 | 66 | 23.8125 | 0.844444 | 0 | 0 | 0 | 0 | 0 | 0.115486 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.222222 | 0.111111 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 2 |
efce13938ff041bbe6490db3e3e8461b1e600d06 | 1,066 | py | Python | test_apps/python_app/example/flows/o1_testcases/prb2.py | Origen-SDK/o2 | 5b0f9a6d113ddebc73c7ee224931e8b2d0301794 | [
"MIT"
] | null | null | null | test_apps/python_app/example/flows/o1_testcases/prb2.py | Origen-SDK/o2 | 5b0f9a6d113ddebc73c7ee224931e8b2d0301794 | [
"MIT"
] | 127 | 2019-11-23T17:09:35.000Z | 2021-09-02T11:06:20.000Z | test_apps/python_app/example/flows/o1_testcases/prb2.py | Origen-SDK/o2 | 5b0f9a6d113ddebc73c7ee224931e8b2d0301794 | [
"MIT"
] | null | null | null | with Flow(bypass_sub_flows=True,
add_flow_enable="enabled",
environment="probe") as flow:
flow.description = '''
An example of creating an entire test program from a single source file
'''
#unless Origen.app.environment.name == 'v93k_global'
flow.set_resources_filename('prb2')
flow.func("erase_all", duration="dynamic", number=10000)
flow.func("margin_read1_all1", number=10010)
flow.func("erase_all", duration="dynamic", number=10020)
flow.func("margin_read1_all1", number=10030)
flow.include('components/prb2_main', number=11000)
flow.func("erase_all", duration="dynamic", number=12000)
flow.func("margin_read1_all1", id='erased_successfully', number=12010)
# Check that an instance variable change in a sub-flow (prb2_main in this case)
# is preserved back here in the main flow
if flow.include_additional_prb2_test:
with flow.if_enable('extra_tests'):
flow.include('components/prb2_main', number=13000)
flow.func("margin_read1_all1", number=14000)
| 36.758621 | 83 | 0.702627 | 145 | 1,066 | 4.97931 | 0.524138 | 0.077562 | 0.077562 | 0.105263 | 0.403047 | 0.371191 | 0.15374 | 0 | 0 | 0 | 0 | 0.068493 | 0.178236 | 1,066 | 28 | 84 | 38.071429 | 0.755708 | 0.158537 | 0 | 0 | 0 | 0 | 0.318792 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0.055556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
eff22d5393945b67e8ca56952bcb67c97756b112 | 474 | py | Python | redcmd/test/autocomp/maincmd_d.py | amol9/redcmd | 34086eb42ec6acc16dbd2b3ea530898a6a287639 | [
"MIT"
] | 1 | 2015-10-26T19:38:28.000Z | 2015-10-26T19:38:28.000Z | redcmd/test/autocomp/maincmd_d.py | amol9/redcmd | 34086eb42ec6acc16dbd2b3ea530898a6a287639 | [
"MIT"
] | null | null | null | redcmd/test/autocomp/maincmd_d.py | amol9/redcmd | 34086eb42ec6acc16dbd2b3ea530898a6a287639 | [
"MIT"
] | null | null | null |
from redcmd.api import maincmd, Arg, PathArg
class args:
pass
def options(headers=None, user_agent=None, cookie_file=PathArg(opt=True, ext_list=['txt'])):
args.headers = headers
args.user_agent = user_agent
args.cookie_file = cookie_file
def output(output_file=None, verbose_level=Arg(default=0, choices=[0, 1, 2 ,3], opt=True)):
args.output_file = output_file
args.verbose_level = verbose_level
@maincmd(add=[options, output])
def curl(url):
a = url
| 19.75 | 92 | 0.732068 | 74 | 474 | 4.513514 | 0.486486 | 0.080838 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012285 | 0.14135 | 474 | 23 | 93 | 20.608696 | 0.808354 | 0 | 0 | 0 | 0 | 0 | 0.006356 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.230769 | false | 0.076923 | 0.076923 | 0 | 0.384615 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
4bc7f5f7839a2000ca76c23100c86acb38942cd7 | 756 | py | Python | src/zhaostephen/vdts/filesystem.py | stephen-zhao/vdts | 51b1b351d79e7706b5bb1e5fdb7196cf16fb70e1 | [
"MIT"
] | 1 | 2020-10-21T06:28:53.000Z | 2020-10-21T06:28:53.000Z | src/zhaostephen/vdts/filesystem.py | stephen-zhao/vdts | 51b1b351d79e7706b5bb1e5fdb7196cf16fb70e1 | [
"MIT"
] | null | null | null | src/zhaostephen/vdts/filesystem.py | stephen-zhao/vdts | 51b1b351d79e7706b5bb1e5fdb7196cf16fb70e1 | [
"MIT"
] | null | null | null | from datetime import datetime
import os
from pathlib import Path
from typing import Dict
from datetime_matcher import DatetimeMatcher
def extract_timeseries_from_directory(dir_path: Path, file_pattern: str) -> Dict[datetime, str]:
# Get list of files in directory
files = list(file for file in os.listdir(str(dir_path)) if (dir_path / file).is_file())
# Extract the datetimes
dtmatcher = DatetimeMatcher()
timepoint_files = list((dtmatcher.extract_datetime(file_pattern, file), file) for file in files)
# Filter out Nones as those without a datetime cannot be a part of the time series
timepoint_to_file = dict((timepoint, file) for timepoint, file in timepoint_files if timepoint is not None)
return timepoint_to_file
| 37.8 | 111 | 0.76455 | 112 | 756 | 5.008929 | 0.419643 | 0.037433 | 0.039216 | 0.046346 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.171958 | 756 | 19 | 112 | 39.789474 | 0.896166 | 0.175926 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.090909 | false | 0 | 0.454545 | 0 | 0.636364 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
4bdbf90455d9f596a575ca6c76388b0d589a8c46 | 348 | py | Python | Python/customerprj/customer/urls.py | min9288/Multicampus | 2aaac730b35e530f8f91cb1ba41c08ee18d59142 | [
"MIT"
] | 2 | 2022-01-18T09:27:42.000Z | 2022-03-29T14:59:00.000Z | Python/customerprj/customer/urls.py | min9288/Multicampus | 2aaac730b35e530f8f91cb1ba41c08ee18d59142 | [
"MIT"
] | null | null | null | Python/customerprj/customer/urls.py | min9288/Multicampus | 2aaac730b35e530f8f91cb1ba41c08ee18d59142 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.customer_list, name='customer_list'),
path('customer/<int:pk>', views.customer_detail, name='customer_detail'),
path('customer/new', views.customer_new, name='customer_new'),
path('customer/<int:pk>/edit', views.customer_edit, name='customer_edit'),
] | 38.666667 | 78 | 0.715517 | 46 | 348 | 5.23913 | 0.326087 | 0.215768 | 0.124481 | 0.141079 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.114943 | 348 | 9 | 79 | 38.666667 | 0.782468 | 0 | 0 | 0 | 0 | 0 | 0.297994 | 0.063037 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 0.25 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4be22245f48287c55d13f35d514d303bee38f2ee | 5,574 | py | Python | database.py | bopopescu/fbserver | e812dbc4dc0cbf2fda19473015a3d7e253718a19 | [
"Apache-2.0"
] | null | null | null | database.py | bopopescu/fbserver | e812dbc4dc0cbf2fda19473015a3d7e253718a19 | [
"Apache-2.0"
] | null | null | null | database.py | bopopescu/fbserver | e812dbc4dc0cbf2fda19473015a3d7e253718a19 | [
"Apache-2.0"
] | 1 | 2020-07-23T19:26:19.000Z | 2020-07-23T19:26:19.000Z | import mysql.connector
import json
import threading
class Database:
def __init__(self):
# print 'init data'
self.cn = mysql.connector.connect(user='root', password='Rvpooh123', database='sdc')
def insert(self, data):
sql = """insert into feature_model
(user_id, post_id, poster_name, rating, is_location, share, comment, like_number, vdo, image, url, create_date)
values (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, now())"""
user_id = data['user_id']
post_id = data['post_id']
poster_name = data['poster_name']
rating = data['rating']
is_location = data['is_location']
share = data['share']
comment = data['comment']
like = data['like_number']
vdo = data['vdo']
image = data['image']
url = data['url']
try:
self.cursor = self.cn.cursor()
self.cursor.execute(sql,(user_id, post_id, poster_name, rating, is_location, share, comment, like, vdo, image, url))
self.cn.commit()
self.cursor.close()
except Exception, e:
print e
def insert2(self, data):
sql = """insert into feature_model
(user_id, post_id, poster_name, rating, is_location, share, comment, like_number, vdo, image, url, tags_number, create_date)
values (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, now())"""
user_id = ''
post_id = ''
poster_name = data['user_name']
rating = data['rating']
is_location = data['is_location']
share = data['share']
comment = data['comment']
like = data['like_number']
vdo = data['vdo']
image = data['image']
url = data['url']
hashtag = data['hashtag']
try:
self.cursor = self.cn.cursor()
self.cursor.execute(sql,(user_id, post_id, poster_name, rating, is_location, share, comment, like, vdo, image, url, hashtag))
self.cn.commit()
self.cursor.close()
except Exception, e:
print e
def insert_filter_el(self, data):
sql = """insert into filter_el
(message, sholdbe, create_date)
values (%s, %s, now())"""
sholdbe = data['sholdbe']
message = data['message']
try:
self.cursor = self.cn.cursor()
self.cursor.execute(sql,(message, sholdbe))
self.cn.commit()
self.cursor.close()
except Exception, e:
print e
def insert_filter_el_2(self, data):
sql = """insert into filter_el
(message, sholdbe, user_post, create_date)
values (%s, %s, %s, now())"""
sholdbe = data['sholdbe']
message = data['message']
user_post = data['user_post']
try:
self.cursor = self.cn.cursor()
self.cursor.execute(sql,(message, sholdbe, user_post))
# print sql
self.cn.commit()
self.cursor.close()
except Exception, e:
print e
def insert_feedback(self, data):
sql = """insert into feed_back
(feed_back, rating, is_location, share, comment,
like_number, vdo, image, url, tags_number,
user_post, user_feed_back, message, create_date)
values (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, now())"""
feed_back = data['feed_back']
rating = data['rating']
is_location = data['is_location']
share = data['share']
comment = data['comment']
like = data['like_number']
vdo = data['vdo']
image = data['image']
url = data['url']
hashtag = data['hashtag']
user_post = data['user_post']
user_feed_back = data['user_feed_back']
message = data['message']
try:
self.cursor = self.cn.cursor()
self.cursor.execute(sql,(feed_back, rating, is_location, share, comment, like, vdo, image, url, hashtag, user_post, user_feed_back, message))
self.cn.commit()
self.cursor.close()
except Exception, e:
print e
def select_filter_el(self):
sql = 'select message from filter where sholdbe = "no"'
ret = []
try:
self.cursor = self.cn.cursor()
self.cursor.execute(sql)
# print sql
for (message) in self.cursor:
# print 'msg ',message[0]
ret.append(message[0])
except Exception, e:
print e
return ret
def insert_fb_filter_save(self, data):
sql = """insert into fb_filter_assessment
(meesage, user_post, filter_status, agree_value, create_date) values (%s, %s, %s, %s, now())""";
message = data['message']
user_post = data['user_post']
agree_value = data['agree_value']
filter_status = data['filter_status']
try:
self.cursor = self.cn.cursor()
self.cursor.execute(sql,(message, user_post, filter_status, agree_value))
print sql
self.cn.commit()
self.cursor.close()
except Exception, e:
print e
def select_inv_fbfiler(self, sql):
ret = []
try:
self.cursor = self.cn.cursor()
self.cursor.execute(sql)
for (message) in self.cursor:
ret.append(message[0])
except Exception, e:
print e
self.cursor.close()
return ret
def insert_training_data(self, dict):
self.template_persist(dict, 'training_data')
def template_persist(self, dict, table_name):
sql_file = ""
sql_value = ""
t_value = []
for k, v in dict.items():
sql_file += k+","
sql_value += "%s,"
t_value.append(v)
sql_file = sql_file[:-1]
sql_value = sql_value[:-1]
sql = "insert into "+table_name+"("+sql_file+") values ("+sql_value+")"
try:
self.cursor = self.cn.cursor()
self.cursor.execute(sql, t_value)
# print sql
self.cn.commit()
self.cursor.close()
except Exception, e:
print e
def select_q(self, sql):
ret = []
try:
self.cursor = self.cn.cursor()
self.cursor.execute(sql)
for t in self.cursor:
ret.append(t)
except Exception, e:
print e
self.cursor.close()
return ret
def commit(self):
self.cn.commit()
def close(self):
self.cursor.close()
self.cn.close()
def close_connection(self):
self.cn.close()
| 27.058252 | 144 | 0.649085 | 808 | 5,574 | 4.321782 | 0.117574 | 0.022337 | 0.028351 | 0.032073 | 0.7752 | 0.735682 | 0.682417 | 0.67669 | 0.655498 | 0.596506 | 0 | 0.002217 | 0.190886 | 5,574 | 205 | 145 | 27.190244 | 0.772062 | 0.01507 | 0 | 0.625698 | 0 | 0.03352 | 0.252691 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.005587 | 0.01676 | null | null | 0.061453 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
4be35ddacf5988052f57f5ee470e3624c7f78782 | 415 | py | Python | curso/PY2/condicao_aninhada/ex4.py | smrsassa/Studying-Python | a5acbce42b85bdd6aea8058ca323fbbd12ce5c22 | [
"MIT"
] | 1 | 2019-10-21T18:19:13.000Z | 2019-10-21T18:19:13.000Z | curso/PY2/condicao_aninhada/ex4.py | smrsassa/Studying-python | a5acbce42b85bdd6aea8058ca323fbbd12ce5c22 | [
"MIT"
] | null | null | null | curso/PY2/condicao_aninhada/ex4.py | smrsassa/Studying-python | a5acbce42b85bdd6aea8058ca323fbbd12ce5c22 | [
"MIT"
] | null | null | null | idade = int(input('digite sua idade: '))
if idade < 18:
tf = 18 - idade
print ('Ainda não é hora de fazer o alistamento')
print ('O alistamento será necessario daqui {} anos'.format(tf))
elif idade == 18:
print ('Esta na hora de se alistar')
else:
tf = idade - 18
print ('Passou do tempo para se alistar')
print ('Voce esta {} anos atrasado'.format(tf))
print ('Alistar-se é importante') | 34.583333 | 68 | 0.648193 | 63 | 415 | 4.269841 | 0.555556 | 0.078067 | 0.089219 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.024845 | 0.224096 | 415 | 12 | 69 | 34.583333 | 0.810559 | 0 | 0 | 0 | 0 | 0 | 0.495192 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.083333 | 0.083333 | 0 | 0.083333 | 0.5 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 2 |
ef00838a514ef6494de9516f564a0071dc4e17d9 | 39,375 | py | Python | release/stubs.min/System/Windows/Forms/__init___parts/ToolStripItem.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/ToolStripItem.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/ToolStripItem.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class ToolStripItem(
Component,
IComponent,
IDisposable,
IDropTarget,
ISupportOleDropSource,
IArrangedElement,
):
""" Represents the abstract base class that manages events and layout for all the elements that a System.Windows.Forms.ToolStrip or System.Windows.Forms.ToolStripDropDown can contain. """
def CreateAccessibilityInstance(self, *args):
"""
CreateAccessibilityInstance(self: ToolStripItem) -> AccessibleObject
Creates a new accessibility object for the System.Windows.Forms.ToolStripItem.
Returns: A new System.Windows.Forms.AccessibleObject for the System.Windows.Forms.ToolStripItem.
"""
pass
def Dispose(self):
"""
Dispose(self: ToolStripItem,disposing: bool)
Releases the unmanaged resources used by the System.Windows.Forms.ToolStripItem and optionally
releases the managed resources.
disposing: true to release both managed and unmanaged resources; false to release only unmanaged resources.
"""
pass
def DoDragDrop(self, data, allowedEffects):
"""
DoDragDrop(self: ToolStripItem,data: object,allowedEffects: DragDropEffects) -> DragDropEffects
Begins a drag-and-drop operation.
data: The object to be dragged.
allowedEffects: The drag operations that can occur.
Returns: One of the System.Windows.Forms.DragDropEffects values.
"""
pass
def GetCurrentParent(self):
"""
GetCurrentParent(self: ToolStripItem) -> ToolStrip
Retrieves the System.Windows.Forms.ToolStrip that is the container of the current
System.Windows.Forms.ToolStripItem.
Returns: A System.Windows.Forms.ToolStrip that is the container of the current
System.Windows.Forms.ToolStripItem.
"""
pass
def GetPreferredSize(self, constrainingSize):
"""
GetPreferredSize(self: ToolStripItem,constrainingSize: Size) -> Size
Retrieves the size of a rectangular area into which a control can be fit.
constrainingSize: The custom-sized area for a control.
Returns: A System.Drawing.Size ordered pair,representing the width and height of a rectangle.
"""
pass
def GetService(self, *args):
"""
GetService(self: Component,service: Type) -> object
Returns an object that represents a service provided by the System.ComponentModel.Component or
by its System.ComponentModel.Container.
service: A service provided by the System.ComponentModel.Component.
Returns: An System.Object that represents a service provided by the System.ComponentModel.Component,or
null if the System.ComponentModel.Component does not provide the specified service.
"""
pass
def Invalidate(self, r=None):
"""
Invalidate(self: ToolStripItem,r: Rectangle)
Invalidates the specified region of the System.Windows.Forms.ToolStripItem by adding it to the
update region of the System.Windows.Forms.ToolStripItem,which is the area that will be
repainted at the next paint operation,and causes a paint message to be sent to the
System.Windows.Forms.ToolStripItem.
r: A System.Drawing.Rectangle that represents the region to invalidate.
Invalidate(self: ToolStripItem)
Invalidates the entire surface of the System.Windows.Forms.ToolStripItem and causes it to be
redrawn.
"""
pass
def IsInputChar(self, *args):
"""
IsInputChar(self: ToolStripItem,charCode: Char) -> bool
Determines whether a character is an input character that the item recognizes.
charCode: The character to test.
Returns: true if the character should be sent directly to the item and not preprocessed; otherwise,false.
"""
pass
def IsInputKey(self, *args):
"""
IsInputKey(self: ToolStripItem,keyData: Keys) -> bool
Determines whether the specified key is a regular input key or a special key that requires
preprocessing.
keyData: One of the System.Windows.Forms.Keys values.
Returns: true if the specified key is a regular input key; otherwise,false.
"""
pass
def MemberwiseClone(self, *args):
"""
MemberwiseClone(self: MarshalByRefObject,cloneIdentity: bool) -> MarshalByRefObject
Creates a shallow copy of the current System.MarshalByRefObject object.
cloneIdentity: false to delete the current System.MarshalByRefObject object's identity,which will cause the
object to be assigned a new identity when it is marshaled across a remoting boundary. A value of
false is usually appropriate. true to copy the current System.MarshalByRefObject object's
identity to its clone,which will cause remoting client calls to be routed to the remote server
object.
Returns: A shallow copy of the current System.MarshalByRefObject object.
MemberwiseClone(self: object) -> object
Creates a shallow copy of the current System.Object.
Returns: A shallow copy of the current System.Object.
"""
pass
def OnAvailableChanged(self, *args):
"""
OnAvailableChanged(self: ToolStripItem,e: EventArgs)
Raises the AvailableChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnBackColorChanged(self, *args):
"""
OnBackColorChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.BackColorChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnBoundsChanged(self, *args):
"""
OnBoundsChanged(self: ToolStripItem)
Occurs when the System.Windows.Forms.ToolStripItem.Bounds property changes.
"""
pass
def OnClick(self, *args):
"""
OnClick(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.Click event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnDisplayStyleChanged(self, *args):
"""
OnDisplayStyleChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.DisplayStyleChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnDoubleClick(self, *args):
"""
OnDoubleClick(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.DoubleClick event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnDragDrop(self, *args):
"""
OnDragDrop(self: ToolStripItem,dragEvent: DragEventArgs)
Raises the System.Windows.Forms.ToolStripItem.DragDrop event.
dragEvent: A System.Windows.Forms.DragEventArgs that contains the event data.
"""
pass
def OnDragEnter(self, *args):
"""
OnDragEnter(self: ToolStripItem,dragEvent: DragEventArgs)
Raises the System.Windows.Forms.ToolStripItem.DragEnter event.
dragEvent: A System.Windows.Forms.DragEventArgs that contains the event data.
"""
pass
def OnDragLeave(self, *args):
"""
OnDragLeave(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.DragLeave event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnDragOver(self, *args):
"""
OnDragOver(self: ToolStripItem,dragEvent: DragEventArgs)
Raises the System.Windows.Forms.ToolStripItem.DragOver event.
dragEvent: A System.Windows.Forms.DragEventArgs that contains the event data.
"""
pass
def OnEnabledChanged(self, *args):
"""
OnEnabledChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.EnabledChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnFontChanged(self, *args):
"""
OnFontChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.Control.FontChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnForeColorChanged(self, *args):
"""
OnForeColorChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.ForeColorChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnGiveFeedback(self, *args):
"""
OnGiveFeedback(self: ToolStripItem,giveFeedbackEvent: GiveFeedbackEventArgs)
Raises the System.Windows.Forms.ToolStripItem.GiveFeedback event.
giveFeedbackEvent: A System.Windows.Forms.GiveFeedbackEventArgs that contains the event data.
"""
pass
def OnLayout(self, *args):
"""
OnLayout(self: ToolStripItem,e: LayoutEventArgs)
Raises the System.Windows.Forms.Control.Layout event.
e: A System.Windows.Forms.LayoutEventArgs that contains the event data.
"""
pass
def OnLocationChanged(self, *args):
"""
OnLocationChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.LocationChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnMouseDown(self, *args):
"""
OnMouseDown(self: ToolStripItem,e: MouseEventArgs)
Raises the System.Windows.Forms.ToolStripItem.MouseDown event.
e: A System.Windows.Forms.MouseEventArgs that contains the event data.
"""
pass
def OnMouseEnter(self, *args):
"""
OnMouseEnter(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.MouseEnter event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnMouseHover(self, *args):
"""
OnMouseHover(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.MouseHover event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnMouseLeave(self, *args):
"""
OnMouseLeave(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.MouseLeave event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnMouseMove(self, *args):
"""
OnMouseMove(self: ToolStripItem,mea: MouseEventArgs)
Raises the System.Windows.Forms.ToolStripItem.MouseMove event.
mea: A System.Windows.Forms.MouseEventArgs that contains the event data.
"""
pass
def OnMouseUp(self, *args):
"""
OnMouseUp(self: ToolStripItem,e: MouseEventArgs)
Raises the System.Windows.Forms.ToolStripItem.MouseUp event.
e: A System.Windows.Forms.MouseEventArgs that contains the event data.
"""
pass
def OnOwnerChanged(self, *args):
"""
OnOwnerChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.OwnerChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnOwnerFontChanged(self, *args):
"""
OnOwnerFontChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.Control.FontChanged event when the
System.Windows.Forms.ToolStripItem.Font property has changed on the parent of the
System.Windows.Forms.ToolStripItem.
e: A System.EventArgs that contains the event data.
"""
pass
def OnPaint(self, *args):
"""
OnPaint(self: ToolStripItem,e: PaintEventArgs)
Raises the System.Windows.Forms.ToolStripItem.Paint event.
e: A System.Windows.Forms.PaintEventArgs that contains the event data.
"""
pass
def OnParentBackColorChanged(self, *args):
"""
OnParentBackColorChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.BackColorChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnParentChanged(self, *args):
"""
OnParentChanged(self: ToolStripItem,oldParent: ToolStrip,newParent: ToolStrip)
Raises the System.Windows.Forms.Control.ParentChanged event.
oldParent: The original parent of the item.
newParent: The new parent of the item.
"""
pass
def OnParentEnabledChanged(self, *args):
"""
OnParentEnabledChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.EnabledChanged event when the
System.Windows.Forms.ToolStripItem.Enabled property value of the item's container changes.
e: An System.EventArgs that contains the event data.
"""
pass
def OnParentForeColorChanged(self, *args):
"""
OnParentForeColorChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.ForeColorChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnParentRightToLeftChanged(self, *args):
"""
OnParentRightToLeftChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.RightToLeftChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnQueryContinueDrag(self, *args):
"""
OnQueryContinueDrag(self: ToolStripItem,queryContinueDragEvent: QueryContinueDragEventArgs)
Raises the System.Windows.Forms.ToolStripItem.QueryContinueDrag event.
queryContinueDragEvent: A System.Windows.Forms.QueryContinueDragEventArgs that contains the event data.
"""
pass
def OnRightToLeftChanged(self, *args):
"""
OnRightToLeftChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.RightToLeftChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnTextChanged(self, *args):
"""
OnTextChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.TextChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def OnVisibleChanged(self, *args):
"""
OnVisibleChanged(self: ToolStripItem,e: EventArgs)
Raises the System.Windows.Forms.ToolStripItem.VisibleChanged event.
e: An System.EventArgs that contains the event data.
"""
pass
def PerformClick(self):
"""
PerformClick(self: ToolStripItem)
Activates the System.Windows.Forms.ToolStripItem when it is clicked with the mouse.
"""
pass
def ProcessCmdKey(self, *args):
"""
ProcessCmdKey(self: ToolStripItem,m: Message,keyData: Keys) -> (bool,Message)
Processes a command key.
m: A System.Windows.Forms.Message,passed by reference,that represents the window message to
process.
keyData: One of the System.Windows.Forms.Keys values that represents the key to process.
Returns: false in all cases.
"""
pass
def ProcessDialogKey(self, *args):
"""
ProcessDialogKey(self: ToolStripItem,keyData: Keys) -> bool
Processes a dialog key.
keyData: One of the System.Windows.Forms.Keys values that represents the key to process.
Returns: true if the key was processed by the item; otherwise,false.
"""
pass
def ProcessMnemonic(self, *args):
"""
ProcessMnemonic(self: ToolStripItem,charCode: Char) -> bool
Processes a mnemonic character.
charCode: The character to process.
Returns: true in all cases.
"""
pass
def ResetBackColor(self):
"""
ResetBackColor(self: ToolStripItem)
This method is not relevant to this class.
"""
pass
def ResetDisplayStyle(self):
"""
ResetDisplayStyle(self: ToolStripItem)
This method is not relevant to this class.
"""
pass
def ResetFont(self):
"""
ResetFont(self: ToolStripItem)
This method is not relevant to this class.
"""
pass
def ResetForeColor(self):
"""
ResetForeColor(self: ToolStripItem)
This method is not relevant to this class.
"""
pass
def ResetImage(self):
"""
ResetImage(self: ToolStripItem)
This method is not relevant to this class.
"""
pass
def ResetMargin(self):
"""
ResetMargin(self: ToolStripItem)
This method is not relevant to this class.
"""
pass
def ResetPadding(self):
"""
ResetPadding(self: ToolStripItem)
This method is not relevant to this class.
"""
pass
def ResetRightToLeft(self):
"""
ResetRightToLeft(self: ToolStripItem)
This method is not relevant to this class.
"""
pass
def ResetTextDirection(self):
"""
ResetTextDirection(self: ToolStripItem)
This method is not relevant to this class.
"""
pass
def Select(self):
"""
Select(self: ToolStripItem)
Selects the item.
"""
pass
def SetBounds(self, *args):
"""
SetBounds(self: ToolStripItem,bounds: Rectangle)
Sets the size and location of the item.
bounds: A System.Drawing.Rectangle that represents the size and location of the
System.Windows.Forms.ToolStripItem
"""
pass
def SetVisibleCore(self, *args):
"""
SetVisibleCore(self: ToolStripItem,visible: bool)
Sets the System.Windows.Forms.ToolStripItem to the specified visible state.
visible: true to make the System.Windows.Forms.ToolStripItem visible; otherwise,false.
"""
pass
def ToString(self):
"""
ToString(self: ToolStripItem) -> str
Returns: A System.String containing the name of the System.ComponentModel.Component,if any,or null if
the System.ComponentModel.Component is unnamed.
"""
pass
def __enter__(self, *args):
"""
__enter__(self: IDisposable) -> object
Provides the implementation of __enter__ for objects which implement IDisposable.
"""
pass
def __exit__(self, *args):
"""
__exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object)
Provides the implementation of __exit__ for objects which implement IDisposable.
"""
pass
def __init__(self, *args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
@staticmethod
def __new__(self, *args): # cannot find CLR constructor
"""
__new__(cls: type)
__new__(cls: type,text: str,image: Image,onClick: EventHandler)
__new__(cls: type,text: str,image: Image,onClick: EventHandler,name: str)
"""
pass
def __str__(self, *args):
pass
AccessibilityObject = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets the System.Windows.Forms.AccessibleObject assigned to the control.
Get: AccessibilityObject(self: ToolStripItem) -> AccessibleObject
"""
AccessibleDefaultActionDescription = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets or sets the default action description of the control for use by accessibility client applications.
Get: AccessibleDefaultActionDescription(self: ToolStripItem) -> str
Set: AccessibleDefaultActionDescription(self: ToolStripItem)=value
"""
AccessibleDescription = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets or sets the description that will be reported to accessibility client applications.
Get: AccessibleDescription(self: ToolStripItem) -> str
Set: AccessibleDescription(self: ToolStripItem)=value
"""
AccessibleName = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets or sets the name of the control for use by accessibility client applications.
Get: AccessibleName(self: ToolStripItem) -> str
Set: AccessibleName(self: ToolStripItem)=value
"""
AccessibleRole = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets or sets the accessible role of the control,which specifies the type of user interface element of the control.
Get: AccessibleRole(self: ToolStripItem) -> AccessibleRole
Set: AccessibleRole(self: ToolStripItem)=value
"""
Alignment = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets a value indicating whether the item aligns towards the beginning or end of the System.Windows.Forms.ToolStrip.
Get: Alignment(self: ToolStripItem) -> ToolStripItemAlignment
Set: Alignment(self: ToolStripItem)=value
"""
AllowDrop = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets a value indicating whether drag-and-drop and item reordering are handled through events that you implement.
Get: AllowDrop(self: ToolStripItem) -> bool
Set: AllowDrop(self: ToolStripItem)=value
"""
Anchor = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets the edges of the container to which a System.Windows.Forms.ToolStripItem is bound and determines how a System.Windows.Forms.ToolStripItem is resized with its parent.
Get: Anchor(self: ToolStripItem) -> AnchorStyles
Set: Anchor(self: ToolStripItem)=value
"""
AutoSize = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets a value indicating whether the item is automatically sized.
Get: AutoSize(self: ToolStripItem) -> bool
Set: AutoSize(self: ToolStripItem)=value
"""
AutoToolTip = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets or sets a value indicating whether to use the System.Windows.Forms.ToolStripItem.Text property or the System.Windows.Forms.ToolStripItem.ToolTipText property for the System.Windows.Forms.ToolStripItem ToolTip.
Get: AutoToolTip(self: ToolStripItem) -> bool
Set: AutoToolTip(self: ToolStripItem)=value
"""
Available = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets a value indicating whether the System.Windows.Forms.ToolStripItem should be placed on a System.Windows.Forms.ToolStrip.
Get: Available(self: ToolStripItem) -> bool
Set: Available(self: ToolStripItem)=value
"""
BackColor = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets the background color for the item.
Get: BackColor(self: ToolStripItem) -> Color
Set: BackColor(self: ToolStripItem)=value
"""
BackgroundImage = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets or sets the background image displayed in the item.
Get: BackgroundImage(self: ToolStripItem) -> Image
Set: BackgroundImage(self: ToolStripItem)=value
"""
BackgroundImageLayout = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets or sets the background image layout used for the System.Windows.Forms.ToolStripItem.
Get: BackgroundImageLayout(self: ToolStripItem) -> ImageLayout
Set: BackgroundImageLayout(self: ToolStripItem)=value
"""
Bounds = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets the size and location of the item.
Get: Bounds(self: ToolStripItem) -> Rectangle
"""
CanRaiseEvents = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets a value indicating whether the component can raise an event.
"""
CanSelect = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets a value indicating whether the item can be selected.
Get: CanSelect(self: ToolStripItem) -> bool
"""
ContentRectangle = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets the area where content,such as text and icons,can be placed within a System.Windows.Forms.ToolStripItem without overwriting background borders.
Get: ContentRectangle(self: ToolStripItem) -> Rectangle
"""
DefaultAutoToolTip = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets a value indicating whether to display the System.Windows.Forms.ToolTip that is defined as the default.
"""
DefaultDisplayStyle = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets a value indicating what is displayed on the System.Windows.Forms.ToolStripItem.
"""
DefaultMargin = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets the default margin of an item.
"""
DefaultPadding = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets the internal spacing characteristics of the item.
"""
DefaultSize = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets the default size of the item.
"""
DesignMode = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets a value that indicates whether the System.ComponentModel.Component is currently in design mode.
"""
DismissWhenClicked = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets a value indicating whether items on a System.Windows.Forms.ToolStripDropDown are hidden after they are clicked.
"""
DisplayStyle = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets or sets whether text and images are displayed on a System.Windows.Forms.ToolStripItem.
Get: DisplayStyle(self: ToolStripItem) -> ToolStripItemDisplayStyle
Set: DisplayStyle(self: ToolStripItem)=value
"""
Dock = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets which System.Windows.Forms.ToolStripItem borders are docked to its parent control and determines how a System.Windows.Forms.ToolStripItem is resized with its parent.
Get: Dock(self: ToolStripItem) -> DockStyle
Set: Dock(self: ToolStripItem)=value
"""
DoubleClickEnabled = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets or sets a value indicating whether the System.Windows.Forms.ToolStripItem can be activated by double-clicking the mouse.
Get: DoubleClickEnabled(self: ToolStripItem) -> bool
Set: DoubleClickEnabled(self: ToolStripItem)=value
"""
Enabled = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets a value indicating whether the parent control of the System.Windows.Forms.ToolStripItem is enabled.
Get: Enabled(self: ToolStripItem) -> bool
Set: Enabled(self: ToolStripItem)=value
"""
Events = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets the list of event handlers that are attached to this System.ComponentModel.Component.
"""
Font = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets the font of the text displayed by the item.
Get: Font(self: ToolStripItem) -> Font
Set: Font(self: ToolStripItem)=value
"""
ForeColor = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets the foreground color of the item.
Get: ForeColor(self: ToolStripItem) -> Color
Set: ForeColor(self: ToolStripItem)=value
"""
Height = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets the height,in pixels,of a System.Windows.Forms.ToolStripItem.
Get: Height(self: ToolStripItem) -> int
Set: Height(self: ToolStripItem)=value
"""
Image = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets the image that is displayed on a System.Windows.Forms.ToolStripItem.
Get: Image(self: ToolStripItem) -> Image
Set: Image(self: ToolStripItem)=value
"""
ImageAlign = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets or sets the alignment of the image on a System.Windows.Forms.ToolStripItem.
Get: ImageAlign(self: ToolStripItem) -> ContentAlignment
Set: ImageAlign(self: ToolStripItem)=value
"""
ImageIndex = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets or sets the index value of the image that is displayed on the item.
Get: ImageIndex(self: ToolStripItem) -> int
Set: ImageIndex(self: ToolStripItem)=value
"""
ImageKey = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets the key accessor for the image in the System.Windows.Forms.ToolStrip.ImageList that is displayed on a System.Windows.Forms.ToolStripItem.
Get: ImageKey(self: ToolStripItem) -> str
Set: ImageKey(self: ToolStripItem)=value
"""
ImageScaling = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets or sets a value indicating whether an image on a System.Windows.Forms.ToolStripItem is automatically resized to fit in a container.
Get: ImageScaling(self: ToolStripItem) -> ToolStripItemImageScaling
Set: ImageScaling(self: ToolStripItem)=value
"""
ImageTransparentColor = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets or sets the color to treat as transparent in a System.Windows.Forms.ToolStripItem image.
Get: ImageTransparentColor(self: ToolStripItem) -> Color
Set: ImageTransparentColor(self: ToolStripItem)=value
"""
IsDisposed = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets a value indicating whether the object has been disposed of.
Get: IsDisposed(self: ToolStripItem) -> bool
"""
IsOnDropDown = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets a value indicating whether the container of the current System.Windows.Forms.Control is a System.Windows.Forms.ToolStripDropDown.
Get: IsOnDropDown(self: ToolStripItem) -> bool
"""
IsOnOverflow = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets a value indicating whether the System.Windows.Forms.ToolStripItem.Placement property is set to System.Windows.Forms.ToolStripItemPlacement.Overflow.
Get: IsOnOverflow(self: ToolStripItem) -> bool
"""
Margin = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets the space between the item and adjacent items.
Get: Margin(self: ToolStripItem) -> Padding
Set: Margin(self: ToolStripItem)=value
"""
MergeAction = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets or sets how child menus are merged with parent menus.
Get: MergeAction(self: ToolStripItem) -> MergeAction
Set: MergeAction(self: ToolStripItem)=value
"""
MergeIndex = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets or sets the position of a merged item within the current System.Windows.Forms.ToolStrip.
Get: MergeIndex(self: ToolStripItem) -> int
Set: MergeIndex(self: ToolStripItem)=value
"""
Name = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets the name of the item.
Get: Name(self: ToolStripItem) -> str
Set: Name(self: ToolStripItem)=value
"""
Overflow = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets whether the item is attached to the System.Windows.Forms.ToolStrip or System.Windows.Forms.ToolStripOverflowButton or can float between the two.
Get: Overflow(self: ToolStripItem) -> ToolStripItemOverflow
Set: Overflow(self: ToolStripItem)=value
"""
Owner = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets the owner of this item.
Get: Owner(self: ToolStripItem) -> ToolStrip
Set: Owner(self: ToolStripItem)=value
"""
OwnerItem = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets the parent System.Windows.Forms.ToolStripItem of this System.Windows.Forms.ToolStripItem.
Get: OwnerItem(self: ToolStripItem) -> ToolStripItem
"""
Padding = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets the internal spacing,in pixels,between the item's contents and its edges.
Get: Padding(self: ToolStripItem) -> Padding
Set: Padding(self: ToolStripItem)=value
"""
Parent = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets the parent container of the System.Windows.Forms.ToolStripItem.
"""
Placement = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets the current layout of the item.
Get: Placement(self: ToolStripItem) -> ToolStripItemPlacement
"""
Pressed = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets a value indicating whether the state of the item is pressed.
Get: Pressed(self: ToolStripItem) -> bool
"""
RightToLeft = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets or sets a value indicating whether items are to be placed from right to left and text is to be written from right to left.
Get: RightToLeft(self: ToolStripItem) -> RightToLeft
Set: RightToLeft(self: ToolStripItem)=value
"""
RightToLeftAutoMirrorImage = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Mirrors automatically the System.Windows.Forms.ToolStripItem image when the System.Windows.Forms.ToolStripItem.RightToLeft property is set to System.Windows.Forms.RightToLeft.Yes.
Get: RightToLeftAutoMirrorImage(self: ToolStripItem) -> bool
Set: RightToLeftAutoMirrorImage(self: ToolStripItem)=value
"""
Selected = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets a value indicating whether the item is selected.
Get: Selected(self: ToolStripItem) -> bool
"""
ShowKeyboardCues = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets a value indicating whether to show or hide shortcut keys.
"""
Size = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets the size of the item.
Get: Size(self: ToolStripItem) -> Size
Set: Size(self: ToolStripItem)=value
"""
Tag = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets the object that contains data about the item.
Get: Tag(self: ToolStripItem) -> object
Set: Tag(self: ToolStripItem)=value
"""
Text = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets the text that is to be displayed on the item.
Get: Text(self: ToolStripItem) -> str
Set: Text(self: ToolStripItem)=value
"""
TextAlign = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets the alignment of the text on a System.Windows.Forms.ToolStripLabel.
Get: TextAlign(self: ToolStripItem) -> ContentAlignment
Set: TextAlign(self: ToolStripItem)=value
"""
TextDirection = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets the orientation of text used on a System.Windows.Forms.ToolStripItem.
Get: TextDirection(self: ToolStripItem) -> ToolStripTextDirection
Set: TextDirection(self: ToolStripItem)=value
"""
TextImageRelation = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets or sets the position of System.Windows.Forms.ToolStripItem text and image relative to each other.
Get: TextImageRelation(self: ToolStripItem) -> TextImageRelation
Set: TextImageRelation(self: ToolStripItem)=value
"""
ToolTipText = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Gets or sets the text that appears as a System.Windows.Forms.ToolTip for a control.
Get: ToolTipText(self: ToolStripItem) -> str
Set: ToolTipText(self: ToolStripItem)=value
"""
Visible = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets a value indicating whether the item is displayed.
Get: Visible(self: ToolStripItem) -> bool
Set: Visible(self: ToolStripItem)=value
"""
Width = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Gets or sets the width in pixels of a System.Windows.Forms.ToolStripItem.
Get: Width(self: ToolStripItem) -> int
Set: Width(self: ToolStripItem)=value
"""
AvailableChanged = None
BackColorChanged = None
Click = None
DisplayStyleChanged = None
DoubleClick = None
DragDrop = None
DragEnter = None
DragLeave = None
DragOver = None
EnabledChanged = None
ForeColorChanged = None
GiveFeedback = None
LocationChanged = None
MouseDown = None
MouseEnter = None
MouseHover = None
MouseLeave = None
MouseMove = None
MouseUp = None
OwnerChanged = None
Paint = None
QueryAccessibilityHelp = None
QueryContinueDrag = None
RightToLeftChanged = None
TextChanged = None
ToolStripItemAccessibleObject = None
VisibleChanged = None
| 23.107394 | 222 | 0.663035 | 4,409 | 39,375 | 5.901565 | 0.114538 | 0.076095 | 0.078171 | 0.088163 | 0.516641 | 0.479093 | 0.450423 | 0.410108 | 0.396849 | 0.378939 | 0 | 0 | 0.247721 | 39,375 | 1,703 | 223 | 23.120963 | 0.878431 | 0.343619 | 0 | 0.331126 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.218543 | false | 0.218543 | 0 | 0 | 0.529801 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
ef0b95e50d6599b1868b907c8745261b0ad6ad76 | 253 | py | Python | apps/users/urls.py | Palameng/Demo | f216982851ca7e024a9afebcb47c575765f51622 | [
"Apache-2.0"
] | null | null | null | apps/users/urls.py | Palameng/Demo | f216982851ca7e024a9afebcb47c575765f51622 | [
"Apache-2.0"
] | null | null | null | apps/users/urls.py | Palameng/Demo | f216982851ca7e024a9afebcb47c575765f51622 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from django.conf.urls import url, include
from users.views import LoginView, LogoutView
urlpatterns = [
url(r'^login/$', LoginView.as_view(), name='user_login'),
url('^logout/$', LogoutView.as_view(), name="logout"),
]
| 25.3 | 61 | 0.667984 | 33 | 253 | 5.030303 | 0.666667 | 0.072289 | 0.120482 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.004587 | 0.13834 | 253 | 9 | 62 | 28.111111 | 0.756881 | 0.083004 | 0 | 0 | 0 | 0 | 0.143478 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.333333 | 0 | 0.333333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
ef14a79b5e2cbeb0d2281169c162a396e604600c | 1,306 | py | Python | GCTM/admin.py | bigbizzy001/GTCManagement | b91ef2368bbce411652cc8ca749359d92910c3ab | [
"MIT"
] | null | null | null | GCTM/admin.py | bigbizzy001/GTCManagement | b91ef2368bbce411652cc8ca749359d92910c3ab | [
"MIT"
] | null | null | null | GCTM/admin.py | bigbizzy001/GTCManagement | b91ef2368bbce411652cc8ca749359d92910c3ab | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Contact, Flight, Hotel, Visa
# Register your models here.
@admin.register(Contact)
class ContactAdmin(admin.ModelAdmin):
list_display = ('name', 'phone', 'subject', 'email', 'description')
list_filter = ('subject', 'email')
search_fields = ('name', 'subject')
@admin.register(Flight)
class FlightAdmin(admin.ModelAdmin):
list_display = ('name', 'phone', 'to', 'departing', 'departure_date', 'passengers', 'flight_type', 'cabin_class')
list_filter = ('departing', 'flight_type', 'cabin_class')
search_fields =('name', 'to', 'departing', 'passengers', 'flight_type', 'cabin_class')
@admin.register(Hotel)
class HotelAdmin(admin.ModelAdmin):
list_display = ('name', 'phone', 'city', 'possible_location', 'check_in_date', 'check_out_date', 'number_of_rooms',
'occupancy', 'hotel_category')
list_filter = ('city', 'possible_location', 'hotel_category')
search_fields = ('city', 'possible_location', 'hotel_category')
@admin.register(Visa)
class VisaAdmin(admin.ModelAdmin):
list_display = ('surname', 'first_name', 'middle_name', 'date_of_birth', 'phone_number', 'email')
list_filter = ('surname', 'phone_number', 'email')
search_fields = ('surname', 'first_name', 'middle_name')
| 37.314286 | 119 | 0.690658 | 148 | 1,306 | 5.831081 | 0.344595 | 0.060255 | 0.088065 | 0.12051 | 0.327926 | 0.121669 | 0 | 0 | 0 | 0 | 0 | 0 | 0.139357 | 1,306 | 34 | 120 | 38.411765 | 0.767794 | 0.019908 | 0 | 0 | 0 | 0 | 0.371765 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.086957 | 0.086957 | 0 | 0.782609 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
ef1bc86cab6b8ddaa87cf59dd6377cb184a13dcf | 781 | py | Python | tools/tester.py | IDRnD/antispoofing-features | 9686f1db59328e7cbbdd48a1b22fc1e03f1085f8 | [
"MIT"
] | 9 | 2020-07-13T18:13:28.000Z | 2021-09-20T04:27:41.000Z | tools/tester.py | IDRnD/antispoofing-features | 9686f1db59328e7cbbdd48a1b22fc1e03f1085f8 | [
"MIT"
] | null | null | null | tools/tester.py | IDRnD/antispoofing-features | 9686f1db59328e7cbbdd48a1b22fc1e03f1085f8 | [
"MIT"
] | 2 | 2020-12-09T00:04:35.000Z | 2021-03-10T14:52:51.000Z | import numpy as np
from scipy.optimize import brentq
from scipy.interpolate import interp1d
from sklearn.metrics import roc_curve
def calc_eer(targets: np.ndarray, scores: np.ndarray):
"""
Calculates Equal error rate score
https://stackoverflow.com/questions/28339746/equal-error-rate-in-python
Parameters:
targets: np.ndarray - binary labels in range {0, 1}
scores: np.ndarray - predicted probabilities for the spoof class
Returns:
eer: float - equal error rate score
threshold: float - threshold boundary
"""
fpr, tpr, thresholds = roc_curve(targets, scores, pos_label=1)
eer = brentq(lambda x: 1. - x - interp1d(fpr, tpr)(x), 0., 1.)
threshold = interp1d(fpr, thresholds)(eer)
return eer * 100, float(threshold)
| 30.038462 | 75 | 0.702945 | 106 | 781 | 5.141509 | 0.537736 | 0.066055 | 0.077064 | 0.069725 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031949 | 0.198464 | 781 | 25 | 76 | 31.24 | 0.838658 | 0.408451 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.444444 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
ef1ee7c11f65d8022811efc35a1c132ce557e733 | 6,142 | py | Python | jcapi/models.py | micahaza/contract-management-api | db6c9b336ae3d5cff1f65d0e210f0499b0285e6e | [
"MIT"
] | 1 | 2020-05-17T01:49:33.000Z | 2020-05-17T01:49:33.000Z | jcapi/models.py | micahaza/contract-management-api | db6c9b336ae3d5cff1f65d0e210f0499b0285e6e | [
"MIT"
] | null | null | null | jcapi/models.py | micahaza/contract-management-api | db6c9b336ae3d5cff1f65d0e210f0499b0285e6e | [
"MIT"
] | null | null | null | from jcapi import db, bcrypt
contract_party = db.Table('contract_parties',
db.Column('user_id', db.Integer, db.ForeignKey('users.id'), nullable=False), # noqa
db.Column('contract_id', db.Integer, db.ForeignKey('contracts.id'), nullable=False) # noqa
)
contract_version_party = db.Table('contract_version_parties',
db.Column('user_id', db.Integer, db.ForeignKey('users.id'), nullable=False), # noqa
db.Column('contract_version_id', db.Integer, db.ForeignKey('contract_versions.id'), nullable=False) # noqa
)
class User(db.Model):
__tablename__ = 'users'
id = db.Column(db.Integer, primary_key=True)
username = db.Column(db.String(64), index=True, unique=True)
first_name = db.Column(db.String(256))
last_name = db.Column(db.String(256))
email = db.Column(db.String(120), index=True, unique=True)
password_hash = db.Column(db.String(128))
active = db.Column(db.Boolean, nullable=False, default=False)
email_verified = db.Column(db.Boolean, nullable=False, default=False)
contracts = db.relationship("Contract",
secondary=contract_party,
lazy=True,
back_populates="parties")
contract_versions = db.relationship("ContractVersion",
secondary=contract_version_party,
lazy=True,
back_populates="parties")
def __init__(self, username, email, password, first_name, last_name):
self.username = username
self.email = email
self.first_name = first_name
self.last_name = last_name
self.password_hash = bcrypt.generate_password_hash(password).decode('utf-8')
def to_dict(self):
return {
'id': self.id,
'username': self.username,
'full_name': "{} {}".format(self.first_name, self.last_name),
'email': self.email
}
@property
def full_name(self):
return("{} {}".format(self.first_name, self.last_name))
class TemplateTag(db.Model):
__tablename__ = 'template_tags'
id = db.Column(db.Integer, primary_key=True)
contract_id = db.Column(db.Integer, db.ForeignKey('contracts.id'), nullable=False)
name = db.Column(db.String(255), nullable=False)
value = db.Column(db.String(255), nullable=False)
def __init__(self, name: str, value: str):
self.name = name
self.value = value
def to_dict(self):
return {
'id': self.id,
'contract_id': self.contract_id,
'name': self.name,
'value': self.value
}
class Contract(db.Model):
__tablename__ = 'contracts'
id = db.Column(db.Integer, primary_key=True)
version = db.Column(db.Integer)
name = db.Column(db.String(128))
description = db.Column(db.Text())
legal_text = db.Column(db.Text())
effective_date = db.Column(db.Date())
expiration_date = db.Column(db.Date())
currency = db.Column(db.String(3))
status = db.Column(db.String(32))
owner_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False)
parties = db.relationship("User",
secondary=contract_party,
lazy=True,
back_populates="contracts")
template_tags = db.relationship("TemplateTag", uselist=True, backref='contract', lazy=True)
def to_dict(self):
return {
'id': self.id,
'version': self.version,
'name': self.name,
'legal_text': self.legal_text,
'description': self.description,
'effective_date': self.effective_date,
'expiration_date': self.expiration_date,
'currency': self.currency,
'status': self.status,
'owner_id': self.owner_id,
'parties': [u.to_dict() for u in self.parties],
'template_tags': [tt.to_dict() for tt in self.template_tags]
}
class TemplateTagVersion(db.Model):
__tablename__ = 'template_tag_versions'
id = db.Column(db.Integer, primary_key=True)
contract_version_id = db.Column(db.Integer, db.ForeignKey('contract_versions.id'), nullable=False)
name = db.Column(db.String(255), nullable=False)
value = db.Column(db.String(255), nullable=False)
def __init__(self, name: str, value: str):
self.name = name
self.value = value
def to_dict(self):
return {
'id': self.id,
'contract_version_id': self.contract_version_id,
'name': self.name,
'value': self.value
}
class ContractVersion(db.Model):
__tablename__ = 'contract_versions'
id = db.Column(db.Integer, primary_key=True)
version = db.Column(db.Integer)
name = db.Column(db.String(128))
description = db.Column(db.Text())
legal_text = db.Column(db.Text())
effective_date = db.Column(db.Date())
expiration_date = db.Column(db.Date())
currency = db.Column(db.String(3))
status = db.Column(db.String(32))
owner_id = db.Column(db.Integer, db.ForeignKey('users.id'), nullable=False)
parties = db.relationship("User",
secondary=contract_version_party,
lazy=True,
back_populates="contract_versions")
template_tags = db.relationship("TemplateTagVersion", uselist=True, backref='contract_version', lazy=True)
def to_dict(self):
return {
'id': self.id,
'version': self.version,
'name': self.name,
'legal_text': self.legal_text,
'description': self.description,
'effective_date': self.effective_date,
'expiration_date': self.expiration_date,
'currency': self.currency,
'status': self.status,
'owner_id': self.owner_id,
'parties': [u.to_dict() for u in self.parties],
'template_tags': [tt.to_dict() for tt in self.template_tags]
}
| 35.50289 | 110 | 0.599316 | 721 | 6,142 | 4.919556 | 0.12344 | 0.090217 | 0.101494 | 0.067663 | 0.730195 | 0.71779 | 0.700874 | 0.658303 | 0.554553 | 0.501833 | 0 | 0.008707 | 0.270759 | 6,142 | 172 | 111 | 35.709302 | 0.783211 | 0.003093 | 0 | 0.633094 | 0 | 0 | 0.109513 | 0.007355 | 0 | 0 | 0 | 0 | 0 | 1 | 0.064748 | false | 0.021583 | 0.007194 | 0.043165 | 0.482014 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
ef50ede0827a4722fb128970a2dc3fccc99b017c | 411 | py | Python | balebot/filters/contact_filter.py | ehsanbarkhordar/reminder_bot | c72e664c71658dd2ec30bb610ffc836b53f000b9 | [
"MIT"
] | 2 | 2019-08-25T08:36:00.000Z | 2019-08-31T09:57:32.000Z | balebot/filters/contact_filter.py | ehsanbarkhordar/reminder_bot | c72e664c71658dd2ec30bb610ffc836b53f000b9 | [
"MIT"
] | null | null | null | balebot/filters/contact_filter.py | ehsanbarkhordar/reminder_bot | c72e664c71658dd2ec30bb610ffc836b53f000b9 | [
"MIT"
] | null | null | null | from balebot.models.messages.contact_message import ContactMessage
from balebot.models.messages.json_message import JsonMessage
from balebot.filters.filter import Filter
class ContactFilter(Filter):
def match(self, message):
if isinstance(message, JsonMessage):
raw_json = message.raw_json
return isinstance(raw_json, ContactMessage)
else:
return False
| 31.615385 | 66 | 0.727494 | 46 | 411 | 6.391304 | 0.5 | 0.112245 | 0.115646 | 0.170068 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.211679 | 411 | 12 | 67 | 34.25 | 0.907407 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1 | false | 0 | 0.3 | 0 | 0.7 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
ef6554e1562eb1026cfbfcf6761ed07898e51179 | 668 | py | Python | tests/test_pbcore_io_BasH5Collection.py | yoshihikosuzuki/pbcore | 956c45dea8868b5cf7d9b8e9ce98ac8fe8a60150 | [
"BSD-3-Clause"
] | null | null | null | tests/test_pbcore_io_BasH5Collection.py | yoshihikosuzuki/pbcore | 956c45dea8868b5cf7d9b8e9ce98ac8fe8a60150 | [
"BSD-3-Clause"
] | null | null | null | tests/test_pbcore_io_BasH5Collection.py | yoshihikosuzuki/pbcore | 956c45dea8868b5cf7d9b8e9ce98ac8fe8a60150 | [
"BSD-3-Clause"
] | null | null | null | from nose.tools import assert_equal, assert_true, assert_false
from numpy.testing import assert_array_equal
from StringIO import StringIO
from pbcore.io import BasH5Collection
from pbcore import data
def lookupSomeReadsByName(bc):
pass
def test():
for fofn in data.getFofns():
bc = BasH5Collection(fofn)
for zmw in bc:
zmwAgain = bc[zmw.zmwName]
assert_equal(zmw.zmwName, zmwAgain.zmwName)
def test_read_iterators():
for fofn in data.getFofns():
bc = BasH5Collection(fofn)
# TODO Add some meaningful tests here
list(bc.subreads())
list(bc.reads())
list(bc.ccsReads())
| 23.034483 | 62 | 0.676647 | 85 | 668 | 5.223529 | 0.470588 | 0.040541 | 0.040541 | 0.058559 | 0.189189 | 0.189189 | 0.189189 | 0.189189 | 0 | 0 | 0 | 0.005929 | 0.242515 | 668 | 28 | 63 | 23.857143 | 0.871542 | 0.052395 | 0 | 0.210526 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.035714 | 0.157895 | 1 | 0.157895 | false | 0.052632 | 0.263158 | 0 | 0.421053 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
322eb8a66d8cb2f80ffd2795750d616bd8a36842 | 1,796 | py | Python | rdm/md_extensions/base.py | dheater/rdm | 3e16b808cdcaa7860767fe99cd66997adc803c35 | [
"MIT"
] | 76 | 2018-05-09T09:53:18.000Z | 2022-03-21T11:55:18.000Z | rdm/md_extensions/base.py | dheater/rdm | 3e16b808cdcaa7860767fe99cd66997adc803c35 | [
"MIT"
] | 68 | 2018-03-24T10:03:09.000Z | 2022-01-19T20:52:36.000Z | rdm/md_extensions/base.py | dheater/rdm | 3e16b808cdcaa7860767fe99cd66997adc803c35 | [
"MIT"
] | 24 | 2018-06-21T19:52:58.000Z | 2022-03-29T13:15:15.000Z | from jinja2 import nodes
from jinja2.ext import Extension
from rdm.util import post_processing_filter_list
class RdmExtension(Extension):
def __init__(self, environment):
super().__init__(environment)
# add the post processing list to the environment.
if not hasattr(environment, 'rdm_post_process_filters'):
environment.extend(rdm_post_process_filters=[])
def preprocess(self, source, name, filename=None):
self.check_add_post_filter()
self.on_start_of_parsing()
return source
def on_start_of_parsing(self):
pass
# Check if there is a post_process_filter method.
# If so add it to the post filtering list if it is not already added.
def check_add_post_filter(self):
post_filter = getattr(self, 'post_process_filter', None)
current_post_filters = post_processing_filter_list(self.environment)
if post_filter and post_filter not in current_post_filters:
current_post_filters.append(post_filter)
# default parser sets up a call back that will add a post process filter if one exists.
def parse(self, parser):
lineno = next(parser.stream).lineno # skip past tag token
args = [arg for arg in generate_block_arguments(parser)]
return nodes.CallBlock(
self.call_method('block_callback', args), [], [], []
).set_lineno(lineno)
def block_callback(self, *args, caller):
self.check_add_post_filter()
self.process_block_args(*args)
return caller()
def process_block_args(self, *args):
pass
def generate_block_arguments(parser):
while parser.stream.current.type != 'block_end':
if not parser.stream.skip_if('comma'):
yield parser.parse_expression()
| 33.259259 | 91 | 0.689866 | 238 | 1,796 | 4.936975 | 0.369748 | 0.059574 | 0.030638 | 0.045957 | 0.062979 | 0.044255 | 0 | 0 | 0 | 0 | 0 | 0.001445 | 0.229399 | 1,796 | 53 | 92 | 33.886792 | 0.847543 | 0.150334 | 0 | 0.114286 | 0 | 0 | 0.046711 | 0.015789 | 0 | 0 | 0 | 0 | 0 | 1 | 0.228571 | false | 0.057143 | 0.085714 | 0 | 0.428571 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
3259fac03bc57f8de4cf94785716079fc108a9bc | 376 | py | Python | code/utils/load_dictionary_from_file.py | mrbarbasa/kaggle-spooky-author | a2ded542288efa0e85a25426722619ed2542d98b | [
"MIT"
] | 1 | 2018-10-09T04:57:03.000Z | 2018-10-09T04:57:03.000Z | code/utils/load_dictionary_from_file.py | mrbarbasa/kaggle-spooky-author | a2ded542288efa0e85a25426722619ed2542d98b | [
"MIT"
] | null | null | null | code/utils/load_dictionary_from_file.py | mrbarbasa/kaggle-spooky-author | a2ded542288efa0e85a25426722619ed2542d98b | [
"MIT"
] | null | null | null | import json
def load_dictionary_from_file(file_path):
"""Load a dictionary from a JSON file.
Parameters
----------
file_path : string
The JSON file path to load the dictionary from.
Returns
-------
dictionary : dict
The dictionary loaded from a JSON file.
"""
with open(file_path, 'r') as f:
return json.load(f)
| 19.789474 | 55 | 0.603723 | 50 | 376 | 4.42 | 0.44 | 0.144796 | 0.081448 | 0.117647 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.289894 | 376 | 18 | 56 | 20.888889 | 0.827715 | 0.553191 | 0 | 0 | 0 | 0 | 0.008 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
326b2695e90a1d1cf51b78fcc111229a572a4cbe | 8,106 | py | Python | nova/tests/functional/api_sample_tests/api_sample_base.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | null | null | null | nova/tests/functional/api_sample_tests/api_sample_base.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | null | null | null | nova/tests/functional/api_sample_tests/api_sample_base.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | 2 | 2017-07-20T17:31:34.000Z | 2020-07-24T02:42:19.000Z | begin_unit
comment|'# Copyright 2013 IBM Corp.'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'# not use this file except in compliance with the License. You may obtain'
nl|'\n'
comment|'# a copy of the License at'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# http://www.apache.org/licenses/LICENSE-2.0'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Unless required by applicable law or agreed to in writing, software'
nl|'\n'
comment|'# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT'
nl|'\n'
comment|'# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the'
nl|'\n'
comment|'# License for the specific language governing permissions and limitations'
nl|'\n'
comment|'# under the License.'
nl|'\n'
nl|'\n'
name|'import'
name|'os'
newline|'\n'
nl|'\n'
name|'import'
name|'testscenarios'
newline|'\n'
nl|'\n'
name|'from'
name|'nova'
op|'.'
name|'api'
op|'.'
name|'openstack'
name|'import'
name|'API_V21_CORE_EXTENSIONS'
comment|'# noqa'
newline|'\n'
name|'import'
name|'nova'
op|'.'
name|'conf'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'test'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'tests'
op|'.'
name|'functional'
name|'import'
name|'api_paste_fixture'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'tests'
op|'.'
name|'functional'
name|'import'
name|'api_samples_test_base'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'tests'
op|'.'
name|'unit'
name|'import'
name|'fake_network'
newline|'\n'
name|'from'
name|'nova'
op|'.'
name|'tests'
op|'.'
name|'unit'
name|'import'
name|'fake_utils'
newline|'\n'
nl|'\n'
DECL|variable|CONF
name|'CONF'
op|'='
name|'nova'
op|'.'
name|'conf'
op|'.'
name|'CONF'
newline|'\n'
name|'CONF'
op|'.'
name|'import_opt'
op|'('
string|"'osapi_compute_extension'"
op|','
nl|'\n'
string|"'nova.api.openstack.compute.legacy_v2.extensions'"
op|')'
newline|'\n'
nl|'\n'
comment|'# API samples heavily uses testscenarios. This allows us to use the'
nl|'\n'
comment|'# same tests, with slight variations in configuration to ensure our'
nl|'\n'
comment|'# various ways of calling the API are compatible. Testscenarios works'
nl|'\n'
comment|'# through the class level ``scenarios`` variable. It is an array of'
nl|'\n'
comment|'# tuples where the first value in each tuple is an arbitrary name for'
nl|'\n'
comment|'# the scenario (should be unique), and the second item is a dictionary'
nl|'\n'
comment|'# of attributes to change in the class for the test.'
nl|'\n'
comment|'#'
nl|'\n'
comment|"# By default we're running scenarios for 2 situations"
nl|'\n'
comment|'#'
nl|'\n'
comment|'# - Hitting the default /v2 endpoint with the v2.1 Compatibility stack'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# - Hitting the default /v2.1 endpoint'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Things we need to set:'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# - api_major_version - what version of the API we should be hitting'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# - microversion - what API microversion should be used'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# - _additional_fixtures - any additional fixtures need'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# NOTE(sdague): if you want to build a test that only tests specific'
nl|'\n'
comment|'# microversions, then replace the ``scenarios`` class variable in that'
nl|'\n'
comment|'# test class with something like:'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# [("v2_11", {\'api_major_version\': \'v2.1\', \'microversion\': \'2.11\'})]'
nl|'\n'
nl|'\n'
nl|'\n'
name|'class'
name|'ApiSampleTestBaseV21'
op|'('
name|'testscenarios'
op|'.'
name|'WithScenarios'
op|','
nl|'\n'
DECL|class|ApiSampleTestBaseV21
name|'api_samples_test_base'
op|'.'
name|'ApiSampleTestBase'
op|')'
op|':'
newline|'\n'
DECL|variable|api_major_version
indent|' '
name|'api_major_version'
op|'='
string|"'v2'"
newline|'\n'
comment|'# any additional fixtures needed for this scenario'
nl|'\n'
DECL|variable|_additional_fixtures
name|'_additional_fixtures'
op|'='
op|'['
op|']'
newline|'\n'
DECL|variable|sample_dir
name|'sample_dir'
op|'='
name|'None'
newline|'\n'
DECL|variable|extra_extensions_to_load
name|'extra_extensions_to_load'
op|'='
name|'None'
newline|'\n'
DECL|variable|_project_id
name|'_project_id'
op|'='
name|'True'
newline|'\n'
nl|'\n'
DECL|variable|scenarios
name|'scenarios'
op|'='
op|'['
nl|'\n'
comment|'# test v2 with the v2.1 compatibility stack'
nl|'\n'
op|'('
string|"'v2'"
op|','
op|'{'
nl|'\n'
string|"'api_major_version'"
op|':'
string|"'v2'"
op|'}'
op|')'
op|','
nl|'\n'
comment|'# test v2.1 base microversion'
nl|'\n'
op|'('
string|"'v2_1'"
op|','
op|'{'
nl|'\n'
string|"'api_major_version'"
op|':'
string|"'v2.1'"
op|'}'
op|')'
op|','
nl|'\n'
comment|'# test v2.18 code without project id'
nl|'\n'
op|'('
string|"'v2_1_noproject_id'"
op|','
op|'{'
nl|'\n'
string|"'api_major_version'"
op|':'
string|"'v2.1'"
op|','
nl|'\n'
string|"'_project_id'"
op|':'
name|'False'
op|','
nl|'\n'
string|"'_additional_fixtures'"
op|':'
op|'['
nl|'\n'
name|'api_paste_fixture'
op|'.'
name|'ApiPasteNoProjectId'
op|']'
op|'}'
op|')'
nl|'\n'
op|']'
newline|'\n'
nl|'\n'
DECL|member|setUp
name|'def'
name|'setUp'
op|'('
name|'self'
op|')'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'flags'
op|'('
name|'use_ipv6'
op|'='
name|'False'
op|','
nl|'\n'
name|'osapi_compute_link_prefix'
op|'='
name|'self'
op|'.'
name|'_get_host'
op|'('
op|')'
op|','
nl|'\n'
name|'osapi_glance_link_prefix'
op|'='
name|'self'
op|'.'
name|'_get_glance_host'
op|'('
op|')'
op|')'
newline|'\n'
name|'if'
name|'not'
name|'self'
op|'.'
name|'all_extensions'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'flags'
op|'('
name|'osapi_compute_extension'
op|'='
op|'['
op|']'
op|')'
newline|'\n'
comment|'# Set the whitelist to ensure only the extensions we are'
nl|'\n'
comment|"# interested in are loaded so the api samples don't include"
nl|'\n'
comment|'# data from extensions we are not interested in'
nl|'\n'
name|'whitelist'
op|'='
name|'API_V21_CORE_EXTENSIONS'
op|'.'
name|'copy'
op|'('
op|')'
newline|'\n'
name|'if'
name|'self'
op|'.'
name|'extension_name'
op|':'
newline|'\n'
indent|' '
name|'whitelist'
op|'.'
name|'add'
op|'('
name|'self'
op|'.'
name|'extension_name'
op|')'
newline|'\n'
dedent|''
name|'if'
name|'self'
op|'.'
name|'extra_extensions_to_load'
op|':'
newline|'\n'
indent|' '
name|'whitelist'
op|'.'
name|'update'
op|'('
name|'set'
op|'('
name|'self'
op|'.'
name|'extra_extensions_to_load'
op|')'
op|')'
newline|'\n'
nl|'\n'
dedent|''
name|'CONF'
op|'.'
name|'set_override'
op|'('
string|"'extensions_whitelist'"
op|','
name|'whitelist'
op|','
nl|'\n'
string|"'osapi_v21'"
op|')'
newline|'\n'
nl|'\n'
comment|'# load any additional fixtures specified by the scenario'
nl|'\n'
dedent|''
name|'for'
name|'fix'
name|'in'
name|'self'
op|'.'
name|'_additional_fixtures'
op|':'
newline|'\n'
indent|' '
name|'self'
op|'.'
name|'useFixture'
op|'('
name|'fix'
op|'('
op|')'
op|')'
newline|'\n'
nl|'\n'
comment|'# super class call is delayed here so that we have the right'
nl|'\n'
comment|"# paste and conf before loading all the services, as we can't"
nl|'\n'
comment|'# change these later.'
nl|'\n'
dedent|''
name|'super'
op|'('
name|'ApiSampleTestBaseV21'
op|','
name|'self'
op|')'
op|'.'
name|'setUp'
op|'('
op|')'
newline|'\n'
nl|'\n'
name|'self'
op|'.'
name|'useFixture'
op|'('
name|'test'
op|'.'
name|'SampleNetworks'
op|'('
name|'host'
op|'='
name|'self'
op|'.'
name|'network'
op|'.'
name|'host'
op|')'
op|')'
newline|'\n'
name|'fake_network'
op|'.'
name|'stub_compute_with_ips'
op|'('
name|'self'
op|'.'
name|'stubs'
op|')'
newline|'\n'
name|'fake_utils'
op|'.'
name|'stub_out_utils_spawn_n'
op|'('
name|'self'
op|'.'
name|'stubs'
op|')'
newline|'\n'
nl|'\n'
comment|'# this is used to generate sample docs'
nl|'\n'
name|'self'
op|'.'
name|'generate_samples'
op|'='
name|'os'
op|'.'
name|'getenv'
op|'('
string|"'GENERATE_SAMPLES'"
op|')'
name|'is'
name|'not'
name|'None'
newline|'\n'
dedent|''
dedent|''
endmarker|''
end_unit
| 16.342742 | 88 | 0.647422 | 1,241 | 8,106 | 4.145044 | 0.193392 | 0.04724 | 0.095257 | 0.043546 | 0.411159 | 0.351283 | 0.230949 | 0.194207 | 0.14619 | 0.105365 | 0 | 0.007672 | 0.115593 | 8,106 | 495 | 89 | 16.375758 | 0.709862 | 0 | 0 | 0.80404 | 0 | 0 | 0.49815 | 0.048483 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.020202 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
326eea591682c6f48758e56c231cfd923620f69a | 199 | py | Python | concatenate_inputs.py | snake-arms/CMfind | b6d4bae5592bcf66c334ee48ed77dc92c275d68b | [
"MIT"
] | null | null | null | concatenate_inputs.py | snake-arms/CMfind | b6d4bae5592bcf66c334ee48ed77dc92c275d68b | [
"MIT"
] | null | null | null | concatenate_inputs.py | snake-arms/CMfind | b6d4bae5592bcf66c334ee48ed77dc92c275d68b | [
"MIT"
] | null | null | null | filenames = ['file1.txt', 'file2.txt', ...]
with open('path/to/output/file', 'w') as outfile:
for fname in filenames:
with open(fname) as infile:
outfile.write(infile.read())
| 33.166667 | 49 | 0.60804 | 27 | 199 | 4.481481 | 0.703704 | 0.132231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.012821 | 0.21608 | 199 | 5 | 50 | 39.8 | 0.762821 | 0 | 0 | 0 | 0 | 0 | 0.190955 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
327b81c24cd54b42510ffd0f272019a9e14827f3 | 139 | py | Python | BOJ_백준/5543 상근날드 (리스트 컴프리헨션, min).py | woorimlee/cpp_CTCI_6E_APSS | ff1d42e871ba853ac3de726df0c609885ba07573 | [
"MIT"
] | 2 | 2020-12-30T03:35:51.000Z | 2021-02-28T20:39:09.000Z | BOJ_백준/5543 상근날드 (리스트 컴프리헨션, min).py | woorimlee/cpp_CTCI_6E_APSS | ff1d42e871ba853ac3de726df0c609885ba07573 | [
"MIT"
] | 1 | 2020-12-08T08:48:40.000Z | 2021-04-09T04:58:57.000Z | BOJ_백준/5543 상근날드 (리스트 컴프리헨션, min).py | woorimlee/Algorithm-Repository | ff1d42e871ba853ac3de726df0c609885ba07573 | [
"MIT"
] | null | null | null | #다섯개 입력받아서
#앞의 세 개 중 가장 싼 거 + 뒤의 두 개 중 가장 싼거 - 50 출력
price = [int(input()) for i in range(5)]
print(min(price[:3]) + min(price[3:]) - 50)
| 27.8 | 43 | 0.57554 | 33 | 139 | 2.424242 | 0.757576 | 0.05 | 0.1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.065421 | 0.230216 | 139 | 4 | 44 | 34.75 | 0.682243 | 0.352518 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.5 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
328018102cdde0dbeac416516c7c99b528eb5c68 | 2,612 | py | Python | argo_workflow_tools/workflow_result.py | shanioren/argo-workflow-tools | d2fb41de3f5ccf9284ff4cb027a886ff61a13e69 | [
"Apache-2.0"
] | 15 | 2021-12-08T20:57:52.000Z | 2022-03-23T19:41:29.000Z | argo_workflow_tools/workflow_result.py | shanioren/argo-workflow-tools | d2fb41de3f5ccf9284ff4cb027a886ff61a13e69 | [
"Apache-2.0"
] | 18 | 2021-12-07T07:49:17.000Z | 2022-03-02T10:27:49.000Z | argo_workflow_tools/workflow_result.py | shanioren/argo-workflow-tools | d2fb41de3f5ccf9284ff4cb027a886ff61a13e69 | [
"Apache-2.0"
] | 3 | 2022-01-09T08:19:11.000Z | 2022-02-09T15:20:08.000Z | from typing import Dict, Union
from argo_workflow_tools.artifact import Artifact
from argo_workflow_tools.workflow_status import WorkflowStatus
from argo_workflow_tools.workflow_status_checker import WorkflowStatusChecker
class WorkflowResult:
""""""
@staticmethod
def _get_outputs(outputs) -> Dict[str, Union[str, Artifact]]:
parameters = outputs.get("parameters")
artifacts = outputs.get("artifacts")
outputs = {}
if parameters:
for parameter in parameters:
outputs[parameter["name"]] = parameter["value"]
if artifacts:
for artifact in artifacts:
outputs[artifact["name"]] = Artifact(artifact["s3"])
return outputs
def __init__(
self,
workflow_name: str,
workflow_status: WorkflowStatus,
workflow_status_checker: WorkflowStatusChecker = None,
):
self.workflow_name = workflow_name
self.status = workflow_status
self.workflow_status_checker = workflow_status_checker
def wait_for_completion(self, timeout=None):
self.workflow_status_checker.wait_for_completion(timeout)
self.status = WorkflowStatus.value_of(
self.workflow_status_checker.current_phase
)
return self.status
def stop(self):
self.workflow_status_checker.stop()
self.status = WorkflowStatus.value_of(
self.workflow_status_checker.current_phase
)
return self.status
def retry(self):
self.workflow_status_checker.retry()
self.status = WorkflowStatus.value_of(
self.workflow_status_checker.current_phase
)
return self.status
def resume(
self,
):
self.workflow_status_checker.resume()
self.status = WorkflowStatus.value_of(
self.workflow_status_checker.current_phase
)
return self.status
def suspend(
self,
):
self.workflow_status_checker.suspend()
self.status = WorkflowStatus.value_of(
self.workflow_status_checker.current_phase
)
return self.status
@property
def outputs(self) -> Dict[str, Union[str, Artifact]]:
if self.status is None or self.status == WorkflowStatus.Running:
return {}
else:
return self._get_outputs(
list(
self.workflow_status_checker.workflow_current_status_data_dict[
"status"
]["nodes"].values()
)[0]["outputs"]
)
| 30.372093 | 83 | 0.625957 | 262 | 2,612 | 5.980916 | 0.20229 | 0.160817 | 0.201021 | 0.191449 | 0.465858 | 0.320357 | 0.275686 | 0.275686 | 0.275686 | 0.275686 | 0 | 0.001086 | 0.294793 | 2,612 | 85 | 84 | 30.729412 | 0.84962 | 0 | 0 | 0.291667 | 0 | 0 | 0.019954 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.055556 | 0 | 0.291667 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
328e544f8dac5d2f6832660626bd6b8ea9eab8c8 | 974 | py | Python | __findLargestProductPairOfAdjacentElements.py | simdevex/01.Basics | cf4f372384e66f4b26e4887d2f5d815a1f8e929c | [
"MIT"
] | null | null | null | __findLargestProductPairOfAdjacentElements.py | simdevex/01.Basics | cf4f372384e66f4b26e4887d2f5d815a1f8e929c | [
"MIT"
] | null | null | null | __findLargestProductPairOfAdjacentElements.py | simdevex/01.Basics | cf4f372384e66f4b26e4887d2f5d815a1f8e929c | [
"MIT"
] | null | null | null | '''
Write a Python program to find the largest product of the pair of
adjacent elements from a given list of integers.
Sample Input:
[1,2,3,4,5,6]
[1,2,3,4,5]
[2,3]
Sample Output:
30
20
6
'''
'''
The zip() function returns a zip object, which is an
iterator of tuples where the first item in each passed iterator is paired together,
and then the second item in each passed iterator are paired together etc.
If the passed iterators have different lengths, the iterator with the least items decides
the length of the new iterator.
iterables can be built-in iterables (like: list, string, dict), or user-defined iterables
'''
def adjacent_num_product(list_nums):
#create 2 tuples. The second tuple is right shifted and multiply the numbers
#single line of return statement with zip
return max(a*b for a, b in zip(list_nums, list_nums[1:]))
print(adjacent_num_product([1,2,3,4,5,6]))
print(adjacent_num_product([1,2,3,4,5]))
print(adjacent_num_product([2,3]))
| 31.419355 | 90 | 0.74846 | 177 | 974 | 4.056497 | 0.497175 | 0.016713 | 0.016713 | 0.022284 | 0.16156 | 0.087744 | 0.077994 | 0.077994 | 0.077994 | 0 | 0 | 0.040293 | 0.159138 | 974 | 30 | 91 | 32.466667 | 0.836386 | 0.308008 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0 | 0.2 | 0.4 | 0.6 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 2 |
32b7c9edd3f2994e678bc9c974e8ddf8c36fa3f0 | 21,102 | py | Python | cmg_ts2cf_loop.py | petercunning/notebook | 5b26f2dc96bcb36434542b397de6ca5fa3b61a0a | [
"MIT"
] | 32 | 2015-01-07T01:48:05.000Z | 2022-03-02T07:07:42.000Z | cmg_ts2cf_loop.py | petercunning/notebook | 5b26f2dc96bcb36434542b397de6ca5fa3b61a0a | [
"MIT"
] | 1 | 2015-04-13T21:00:18.000Z | 2015-04-13T21:00:18.000Z | cmg_ts2cf_loop.py | petercunning/notebook | 5b26f2dc96bcb36434542b397de6ca5fa3b61a0a | [
"MIT"
] | 30 | 2015-01-28T09:31:29.000Z | 2022-03-07T03:08:28.000Z | # -*- coding: utf-8 -*-
# <nbformat>3.0</nbformat>
# <markdowncell>
# #Convert existing time series NetCDF files in 4D (T,Z,Y,X) "grid" format to CF-1.6 format
# <markdowncell>
# All the USGS time series data has traditionally been stored in PMEL EPIC-compliant NetCDF files. These files use EPIC codes for
# <codecell>
import glob
import os
import netCDF4
import StringIO
import pandas as pd
import re
# <codecell>
projs = '''
ARGO_MERCHANT,B. Butman,Argo Merchant Experiment,A moored array deployed after the ARGO MERCHANT ran aground onNantucket Shoals designed to help understand the fate of the spilled oil.
BUZZ_BAY,B. Butman,Currents and Sediment Transport in Buzzards Bay,Investigation of the near-bottom circulation in Buzzards Bay and consequent transport of fine-grained sediments that may be contaminated with PCBs from inner New Bedford Harbor.
CAMP,B. Butman,California Area Monitoring Program (CAMP),A four-year multi-disciplinary field and laboratory study to investigate the sediment transport regime in the vicinity of production drilling rigs in the Santa Barbara Basin
CAPE_COD_BAY,B. Butman,Currents and Sediment Transport in Cape Cod Bay,A pilot study to determine the effect of winter storms on sediment movement at two potential dredge spoil disposal areas.
CC_MISC,B. Butman,Transport studies - Nauset Inlet,Part of a collaborative study of sediment movement in Nauset Inlet.
DEEP_REEF,J. Lacey,Gulf of Mexico - Pinnacles,Pressure data from the Gulf of Mexico
DWDS_106,B. Butman,Sediment Transport at Deep Water Dump Site 106,Near-bottom current measurements to understand the fate and transport of sludge from the New York Metropolitan region discharged at the sea surface.
ECOHAB_II,R. Signell,Ecology of Harmful Algal Blooms (ECOHAB-II),A field program to continue investigating the transport and fate of toxic dinoflagellate blooms in the western Gulf of Maine.
ECOHAB_I,R. Signell,Ecology of Harmful Algal Blooms (ECOHAB-I),A field program to study the transport and fate of toxic dinoflagellate blooms in the western Gulf of Maine.
EUROSTRATAFORM,C. Sherwood,EuroSTRATAFORM,The EuroSTRATAFORM Po and Apennine Sediment Transport and Accumulation (PASTA) experiment was an international study of sediment-transport processes and formation of geological strata in the Adriatic Sea.
FARALLONES,M. Noble,Farallons,Program to measure the currents and circulation on the continental slope off San Francisco CA and thus infer the transport of dredged materialat the newly-established deep-water disposal site.
GB_SED,B. Butman,Georges Bank Current and Sediment Transport Studies,A series of studies to assess environmental hazards to petroleum development in the Georges Bank and New England Shelf region
GLOBEC_GB,R. Schlitz,GLOBEC Georges Bank Program,A moored array program to investigate the circulation and mixing of plankton on Georges Bank.
GLOBEC_GSC,R. Schlitz,GLOBEC Great South Channel Circulation Experiment,A moored array program to investigate the recirculation of water and plankton around Georges Bank
GULF_MAINE,B. Butman,Deep Circulation in the Gulf of Maine,A two-year field study to investigate the deep flow between the major basins in the Gulf of Maine and the effects on the distribution of suspended sediments.
HUDSON_SVALLEY,B. Butman,Circulation and Sediment Transport in the Hudson Shelf Valley,Field experiments have been carried out to understand the transport of sediments and associated contaminants in the Hudson Shelf Valley offshore of New York.
KARIN_RIDGE,M. Noble,Karin Ridge Experiment,Current measurements collected at 2 sites in Karin Ridge Seamount.
LYDONIA_C,B. Butman,Lydonia Canyon Dynamics Experiment,A major field experiment to determine the importance of submarine canyons in sediment transport along and across the continental margin.
MAB_SED,B. Butman,Sediment Transport Observations in the Middle Atlantic Bight,A series of studies to assess environmental hazards to petroleum development in the Middle Atlantic Bight.
MAMALA_BAY,D. Cacchione,Mamala bay Experiment,Current measurements collected at 350-450 meters in Mamala Bay near Waikiki Beach.
MBAY_CIRC,R. Signell, Massachusetts Bay Circulation Experiment,Current measurements collected at 6 sites in Massachusetts Bay throughout the year to map the tidal wind and density driven currents.
MBAY_IWAVE,B. Butman,Massachusetts Bay Internal Wave Experiment,A 1-month 4-element moored array experiment to measure the currents associated with large-amplitude internal waves generated by tidal flow across Stellwagen Bank.
MBAY_LTB,B. Butman,Long-term observations in Massachusetts Bay; Site B-Scituate,Measurements of currents and other oceanographic properties were made to assess the impact of sewage discharge from the proposed outfall site.
MBAY_LT,B. Butman,Long-term observations in Massachusetts Bay; Site A-Boston Harbor,Measurements of currents and other oceanographic properties were made to assess the impact of sewage discharge from the proposed outfall site.
MBAY_STELL,R. Signell,Monitoring on Stellwagen Bank,A year-long series of current measurements on the eastern flank of Stellwagen Bank to document the currents at the mouth of Massachusetts Bay driven by the Maine Coastal current.
MBAY_WEST,B. Butman,Currents and Sediment Transport in Western Massachusetts Bay,A pilot winter-time experiment to investigate circulation and sediment transport. Designed to provide information to aid in citing the new ocean outfall for the Boston sewer system.
MOBILE_BAY,B. Butman,Mobile Bay Study,Measure currents and transport out of Mobile Bay.
MONTEREY_BAY,M. Noble,Monterey Bay National Marine Sanctuary Program,Part of a large multi-disciplinary experiment to characterize the geologic environment and to generate a sediment budget.
MONTEREY_CAN,M. Noble,Monterey Canyon Experiment, A program to determine the mechanisms that govern the circulation within and the transport of sediment and water through Monterey Submarine Canyon.
MYRTLEBEACH,J. Warner,Myrtle Beach Experiment SC,Measurements collected as part of a larger study to understand the physical processes that control the transport of sediments in Long Bay South Carolina.
NE_SLOPE,B. Butman,Currents on the New England Continental Slope,A study designed to describe the currents and to investigate the transport of sediment from the shelf to the slope.
OCEANOG_C,B. Butman,Oceanographer Canyon Dynamics Experiment,A field experiment to determine the importance of submarine canyons in sediment transport along and across the continental margin.
ORANGE_COUNTY,M. Noble,Orange County Sanitation District Studies,Observations to monitor coastal ocean process that transport suspended material and associated comtaminants across the shelf
PONCHARTRAIN,R. Signell,Lake Ponchartrain Project,A series of moored array studies to investigate the circulation and particle transport in Lake Pontchartrain.
PV_SHELF04,M. Noble,Palos Verdes Shelf 2004,Additional observations to estimate the quantity and direction of sediment erosion and transport on the shelf near the White Point ocean outfalls.
PV_SHELF07,M. Noble,Palos Verdes Shelf 2007,Follow-up observations to evaluate how often coastal ocean processes move the DDT contaminated sediments near the White Point ocean outfalls.
PV_SHELF,M. Noble,Palos Verdes Shelf Study,Initial observations of currents and circulation near the White Point ocean outfalls determine how often coastal ocean processes move the DDT contaminated sediments in this region.
SAB_SED,B. Butman,Sediment Transport Observations in the Southern Atlantic Bight,A series of studies to assess environmental hazards to petroleum development in the South Atlantic Bight.
SOUTHERN_CAL,M. Noble,Southern California Project,A series of moorings were deployed to understand how coastal ocean processes that move sediments change with location on the shelf.
STRESS,B. Butman,Sediment Transport on Shelves and Slopes (STRESS),Experiment on the California continental margin to investigate storm-driven sediment transport.
WRIGHTSVILLE,R. Thieler,Wrightsville Beach Study, Measurements of bottom currents and waves to investigate the flow field and sediment transport in a rippled scour depression offshore of Wrightsville Beach NC.
DIAMONDSHOALS,J. Warner,Cape Hatteras- Diamond Shoals,This experiment was designed to investigate the ocean circulation and sediment transport dynamics at Diamond Shoals NC.
CHANDELEUR,C. Sherwood,Chandeleur Islands Oceanographic Measurements,A program to measure waves water levels and currents near the Chandeleur Islands Louisiana and adjacent berm construction site.
WFAL,N. Ganju,West Falmouth Harbor Fluxes,Oceanographic and water-quality observations made at six locations in West Falmouth Harbor and Buzzards Bay.
BW2011,N. Ganju, Blackwater 2011, Oceanographic and Water-Quality Measurements made at several sites in 2 watersheds in Blackwater National Wildlife Refuge.
MVCO_11,C. Sherwood, OASIS MVCO 2011, Near-seabed Oceanographic Observations made as part of the 2011 OASIS Project at the MVCO.
HURRIRENE_BB,B. Butman, Observations in Buzzards Bay during and after a Hurricane, Oceanographic data collected in Buzzards Bay MA during Hurricane Irene August 2011.'''
# <codecell>
project = pd.read_csv(StringIO.StringIO(projs.strip()),
sep=",\s*",index_col='project_id',
names=['project_id', 'project_pi', 'project_name','project_summary'])
# <codecell>
project.ix['PV_SHELF']
# <codecell>
project.ix['PV_SHELF'].ix['project_pi']
# <codecell>
len(project)
# <codecell>
for index,row in project.iterrows():
print index,row['project_pi']
# <codecell>
""" this is Ellyn's old Matlab code:
function nname=lookup_cf(long_name)
% LOOKUP_CF Get CF equivalent name for EPIC variable long_name
% return the new name string or [] if there's no equivalent
%
if(strfind(lower(long_name),'temp'))
nname='sea_water_temperature';
elseif (strfind(lower(long_name),'cond'))
nname='sea_water_electrical_conductivity';
elseif (strfind(lower(long_name),'sal'))
nname='sea_water_salinity';
elseif (strfind(lower(long_name),'sigma'))
nname='sea_water_sigma_theta';
% also have to deal with the min, max std of vels for burst stats files
elseif (strfind(lower(long_name),'east'))
nname='eastward_sea_water_velocity';
elseif (strfind(lower(long_name),'north'))
nname='northward_sea_water_velocity';
elseif (strfind(lower(long_name),'vertical'))
nname='upward_sea_water_velocity';
elseif (strfind(lower(long_name),'pitch'))
nname='platform_pitch_angle';
elseif (strfind(lower(long_name),'roll'))
nname='platform_roll_angle';
elseif (strfind(lower(long_name),'head'))
nname='platform_orientation';
elseif (strfind(lower(long_name),'pres'))
if ~isempty(strfind(lower(long_name),'dev')) || ~isempty(strfind(lower(long_name),'std'))
nname=[];
else
nname='sea_water_pressure';
end
elseif (strfind(lower(long_name),'cond'))
nname='sea_water_electrical_conductivity';
elseif (strfind(lower(long_name),'speed'))
if (strfind(lower(long_name),'rotor'))
nname=[];
else
nname='sea_water_speed';
end
elseif (strfind(lower(long_name),'direction'))
nname='direction_of_sea_water_velocity';
else
nname=[];
end
disp([long_name ' : ' nname])
""";
# <codecell>
#os.chdir('/usgs/data2/emontgomery/stellwagen/Data/ARGO_MERCHANT')
root_dir='/usgs/data2/emontgomery/stellwagen/Data/'
#root_dir='/usgs/data2/emontgomery/stellwagen/Data/MVCO_11'
odir='/usgs/data2/emontgomery/stellwagen/CF-1.6/'
os.chdir(root_dir)
# <codecell>
# now find all the unique names, long_names & units
names = set()
long_names = set()
units = set()
epic_keys = set()
for path, subdirs, files in os.walk(root_dir):
for name in files:
file= os.path.join(path, name)
try:
nc=netCDF4.Dataset(file)
for var in nc.variables.keys():
names.add(var)
try:
long_names.add(nc.variables[var].long_name)
except:
pass
try:
units.add(nc.variables[var].units)
except:
pass
try:
epic_keys.add(nc.variables[var].epic_key)
except:
pass
except:
pass
# <codecell>
names= list(names)
long_names = list(long_names)
units = list(units)
epic_keys = list(epic_keys)
# <codecell>
print len(names)
print len(long_names)
print len(units)
print len(epic_keys)
# <codecell>
# let's use Ellyn's approach of matching substrings in the long_names to deduce standard_names
# <codecell>
# air temp, frtemp, laser temp factor, internal, temp diff
filter(lambda x:re.search(r'temp',x.lower()), long_names)
# <codecell>
# seconds, second
filter(lambda x:re.search(r'cond',x.lower()), long_names)
# <codecell>
filter(lambda x:re.search(r'sal',x.lower()), long_names)
# <codecell>
filter(lambda x:re.search(r'sigma',x.lower()), long_names)
# <codecell>
# deal with burst data, std dev, resolution velocity, variance
filter(lambda x:re.search(r'east',x.lower()), long_names)
# <codecell>
filter(lambda x:re.search(r'north',x.lower()), long_names)
# <codecell>
filter(lambda x:re.search(r'vertical',x.lower()), long_names)
# <codecell>
# wind, rotor speed
filter(lambda x:re.search(r'speed',x.lower()), long_names)
# <codecell>
# std dev
filter(lambda x:re.search(r'pitch',x.lower()), long_names)
# <codecell>
filter(lambda x:re.search(r'roll',x.lower()), long_names)
# <codecell>
# std dev
filter(lambda x:re.search(r'heading',x.lower()), long_names)
# <codecell>
# std, dev, wave height spectra, barometric, presscheck
pres = filter(lambda x:re.search(r'press',x.lower()), long_names)
pres
# <codecell>
filter(lambda x:re.search(r'std|dev',x.lower()), pres)
# <codecell>
# save only direction and current direction
filter(lambda x:re.search(r'direct',x.lower()), long_names)
# <codecell>
f = open('/usgs/data2/notebook/names.txt','w')
f.write("\n".join(names))
f.close()
f = open('/usgs/data2/notebook/long_names.txt','w')
f.write("\n".join(long_names))
f.close()
f = open('/usgs/data2/notebook/units.txt','w')
f.write("\n".join(units))
f.close()
# <headingcell level=2>
# Create a dictionary with `standard_name` to `NetCDF variable` mapping
# <codecell>
d={}
# <codecell>
d['sea_water_temperature']=['instrument transducer temp.', 'temperature (c)','fr temp',
'adp transducer temp.','adcp transducer temp.','transducer temp.','temp 1','temp 2',
'temperature','internal temperature','frtemp','temp 2 q','temp','temp lp','sea surface temperature (degrees C)']
# <codecell>
d['sea_water_salinity'] = ['salinity 2 q','salinity 1','ctd salinity, pss-78','salinity','salinity (ppt)','salinity (psu)','salinity']
# <codecell>
d['northward_sea_water_velocity']=['northward velocity','north','mean northward velocity','northward velocity','north lp']
# <codecell>
d['eastward_sea_water_velocity']=['eastward velocity','east','mean eastward velocity','eastward velocity','east lp']
# <codecell>
def grid2dsg(ifile,ofile,coord_vars=['time','time2','depth','lat','lon'],
project_name=None,project_pi=None,project_summary=None):
nc = netCDF4.Dataset(ifile)
id = '%s/%s' % (project_name,ifile.split('.')[0])
#id = ifile.split('.')[0]
vars=nc.variables.keys()
data_vars = [var for var in vars if var not in coord_vars]
nt = len(nc.dimensions['time'])
nz = len(nc.dimensions['depth'])
# create dimensions of output file
nco = netCDF4.Dataset(ofile,'w',clobber=True)
nco.createDimension('time',nt)
if nz > 1:
nco.createDimension('depth',nz)
nchar=20
nco.createDimension('nchar',nchar)
# create coordinate variables
time_v = nco.createVariable('time', 'f8', ('time'))
lon_v = nco.createVariable('lon','f4')
lat_v = nco.createVariable('lat','f4')
if nz > 1:
depth_v = nco.createVariable('depth','f4',dimensions='depth')
else:
depth_v = nco.createVariable('depth','f4')
station_v = nco.createVariable('site','S1',('nchar'))
# write global attributes
g_attdict = nc.__dict__
g_attdict['Conventions'] = 'CF-1.6'
if nz>1:
g_attdict['featureType'] = 'timeSeriesProfile'
else:
g_attdict['featureType'] = 'timeSeries'
g_attdict['naming_authority'] = 'gov.usgs'
g_attdict['id'] = id
g_attdict['source'] = 'USGS'
g_attdict['institution'] = 'USGS Woods Hole Coastal and Marine Science Center'
g_attdict['project'] = 'Coastal and Marine Geology Program'
g_attdict['title'] = '%s/%s/%s' % (g_attdict['source'],project_name,g_attdict['id'])
g_attdict['keywords']='Oceans > Ocean Pressure > Water Pressure, Oceans > Ocean Temperature > Water Temperature, Oceans > Salinity/Density > Conductivity, Oceans > Salinity/Density > Salinity'
g_attdict['keywords_vocabulary']='GCMD Science Keywords'
g_attdict['standard_name_vocabulary'] = 'CF-1.6'
g_attdict['creator_email'] = 'rsignell@usgs.gov'
g_attdict['creator_name'] = 'Rich Signell'
g_attdict['creator_phone'] = '+1 (508) 548-8700'
g_attdict['creator_url'] = 'http://www.usgs.gov'
g_attdict['publisher_email'] = 'emontgomery@usgs.gov'
g_attdict['publisher_name'] = 'Ellyn Montgomery'
g_attdict['publisher_phone'] = '+1 (508) 548-8700'
g_attdict['publisher_url'] = 'http://www.usgs.gov'
g_attdict['contributor_name'] = project_pi
g_attdict['contributor_role'] = 'principalInvestigator' #from esip ACDD
g_attdict['summary'] = project_summary
nco.setncatts(g_attdict)
# write station variable
station_v.cf_role = 'timeseries_id'
station_v.standard_name = 'station_id'
data = numpy.empty((1,),'S'+repr(nchar))
data[0] = ifile.split('.')[0]
station_v[:] = netCDF4.stringtochar(data)
# write time variable
time_v.units = 'milliseconds since 1858-11-17 00:00:00 +0:00'
time_v.standard_name = 'time'
time_v.calendar = 'gregorian'
time_v[:] = (np.int64(nc.variables['time'][:])-2400001)*3600*24*1000 + nc.variables['time2'][:]
# write lon variable
lon_v.units = 'degree_east'
lon_v.standard_name = 'longitude'
lon_v[:] = nc.variables['lon'][:]
# write lat variable
lat_v.units = 'degree_north'
lat_v.standard_name = 'latitude'
lat_v[:] = nc.variables['lat'][:]
# write depth variable
depth_v.units = 'm'
depth_v.standard_name = 'depth'
depth_v.positive = 'down'
depth_v.axis = 'Z'
depth_v[:] = nc.variables['depth'][:]
# create the data variables
var_v=[]
for varname in data_vars:
ncvar = nc.variables[varname]
# if time series variable
if size(ncvar) == nt:
var = nco.createVariable(varname,ncvar.dtype,('time'))
elif size(ncvar) == nz:
var = nco.createVariable(varname,ncvar.dtype,('depth'))
else:
var = nco.createVariable(varname,ncvar.dtype,('time','depth'))
# load old variable attributes and modify if necessary
attdict = ncvar.__dict__
# if dounpackshort and 'scale_factor' in attdict: del attdict['scale_factor']
attdict['coordinates'] = 'time lon lat depth'
# assign standard_name if in dictionary
a =[k for (k, v) in d.iteritems() if attdict['long_name'].strip().lower() in v]
if len(a)==1: attdict['standard_name']=a[0]
# write variable attributes
var.setncatts(attdict)
# write the data
# print ncvar
var[:] = ncvar[:]
nco.close()
# <codecell>
root_idir='/usgs/data2/emontgomery/stellwagen/Data/'
#root_dir='/usgs/data2/emontgomery/stellwagen/Data/MVCO_11'
root_odir='/usgs/data2/emontgomery/stellwagen/CF-1.6/'
os.chdir(root_dir)
# <codecell>
types = ('*.nc', '*.cdf')
coord_vars = ['time','time2','depth','lat','lon']
badfiles = []
goodfiles = []
for index,row in project.iterrows():
idir = os.path.join(root_idir,index)
os.chdir(idir)
odir = os.path.join(root_odir,index)
if not os.path.exists(odir):
os.makedirs(odir)
ncfiles = []
for files in types:
ncfiles.extend(glob.glob(files))
print index, len(ncfiles)
project_name = index
project_pi = project.ix[index].ix['project_pi']
project_summary = project.ix[index].ix['project_summary']
print project_name,project_pi,project_summary
for ifile in ncfiles:
ofile = os.path.join(odir,ifile)
print ifile,ofile
try:
grid2dsg(ifile,ofile,coord_vars = coord_vars,
project_name = project_name,
project_pi = project_pi,
project_summary = project_summary)
goodfiles.append(ifile)
except:
badfiles.append(ifile)
# <codecell>
len(badfiles)
# <codecell>
len(goodfiles)
# <codecell>
print badfiles
# <codecell>
| 43.599174 | 262 | 0.729315 | 2,977 | 21,102 | 5.076923 | 0.241518 | 0.017864 | 0.017997 | 0.022496 | 0.277954 | 0.214172 | 0.186119 | 0.152044 | 0.1228 | 0.116316 | 0 | 0.009853 | 0.167946 | 21,102 | 483 | 263 | 43.689441 | 0.850951 | 0.090892 | 0 | 0.108 | 0 | 0.184 | 0.625093 | 0.025976 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.016 | 0.032 | null | null | 0.036 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
32b843978dacba5095bbcbe775123901aa0a7bdf | 5,978 | py | Python | grakn/concept/type/type.py | jmsfltchr/typedb-client-python | 2007225e8800dc84872c70136f74c4504693359b | [
"Apache-2.0"
] | null | null | null | grakn/concept/type/type.py | jmsfltchr/typedb-client-python | 2007225e8800dc84872c70136f74c4504693359b | [
"Apache-2.0"
] | null | null | null | grakn/concept/type/type.py | jmsfltchr/typedb-client-python | 2007225e8800dc84872c70136f74c4504693359b | [
"Apache-2.0"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not 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,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
from typing import Callable, List
import grakn_protocol.protobuf.concept_pb2 as concept_proto
import grakn_protocol.protobuf.transaction_pb2 as transaction_proto
from grakn.common.exception import GraknClientException
from grakn.concept.proto import concept_proto_builder, concept_proto_reader
from grakn.concept.concept import Concept, RemoteConcept
class Type(Concept):
def __init__(self, label: str, is_root: bool):
if not label:
raise GraknClientException("Label must be a non-empty string.")
self._label = label
self._is_root = is_root
self._hash = hash(label)
def get_label(self):
return self._label
def is_root(self):
return self._is_root
def is_type(self):
return True
def __str__(self):
return type(self).__name__ + "[label:" + self.get_label() + "]"
def __eq__(self, other):
if other is self:
return True
if not other or type(self) != type(other):
return False
return self.get_label() == other.get_label()
def __hash__(self):
return self._hash
class RemoteType(RemoteConcept):
def __init__(self, transaction, label: str, is_root: bool):
if not transaction:
raise GraknClientException("Transaction must be set.")
if not label:
raise GraknClientException("Label must be a non-empty string.")
self._transaction = transaction
self._label = label
self._is_root = is_root
self._hash = hash((self._transaction, label))
def get_label(self):
return self._label
def is_root(self):
return self._is_root
def set_label(self, label: str):
req = concept_proto.Type.Req()
set_label_req = concept_proto.Type.SetLabel.Req()
set_label_req.label = label
req.type_set_label_req.CopyFrom(set_label_req)
self._execute(req)
self._label = label
self._hash = hash((self._transaction, label))
def is_abstract(self):
req = concept_proto.Type.Req()
req.type_is_abstract_req.CopyFrom(concept_proto.Type.IsAbstract.Req())
res = self._execute(req)
return res.type_is_abstract_res.abstract
def is_type(self):
return True
def set_supertype(self, _type: Type):
req = concept_proto.Type.Req()
supertype_req = concept_proto.Type.SetSupertype.Req()
supertype_req.type.CopyFrom(concept_proto_builder.type_(_type))
req.type_set_supertype_req.CopyFrom(supertype_req)
self._execute(req)
def get_supertype(self):
req = concept_proto.Type.Req()
req.type_get_supertype_req.CopyFrom(concept_proto.Type.GetSupertype.Req())
res = self._execute(req).type_get_supertype_res
return concept_proto_reader.type_(res.type) if res.WhichOneof("res") == "type" else None
def get_supertypes(self):
method = concept_proto.Type.Req()
method.type_get_supertypes_req.CopyFrom(concept_proto.Type.GetSupertypes.Req())
return self._type_stream(method, lambda res: res.type_get_supertypes_res.types)
def get_subtypes(self):
method = concept_proto.Type.Req()
method.type_get_subtypes_req.CopyFrom(concept_proto.Type.GetSubtypes.Req())
return self._type_stream(method, lambda res: res.type_get_subtypes_res.types)
def delete(self):
method = concept_proto.Type.Req()
method.type_delete_req.CopyFrom(concept_proto.Type.Delete.Req())
self._execute(method)
def is_deleted(self):
return not self._transaction.concepts()._get_thing_type(self.get_label())
def _type_stream(self, method: concept_proto.Type.Req, type_list_getter: Callable[[concept_proto.Type.Res], List[concept_proto.Type]]):
method.label = self.get_label()
request = transaction_proto.Transaction.Req()
request.type_req.CopyFrom(method)
return map(lambda type_proto: concept_proto_reader.type_(type_proto), self._transaction._stream(request, lambda res: type_list_getter(res.type_res)))
def _thing_stream(self, method: concept_proto.Type.Req, thing_list_getter: Callable[[concept_proto.Type.Res], List[concept_proto.Thing]]):
method.label = self.get_label()
request = transaction_proto.Transaction.Req()
request.type_req.CopyFrom(method)
return map(lambda thing_proto: concept_proto_reader.thing(thing_proto), self._transaction._stream(request, lambda res: thing_list_getter(res.type_res)))
def _execute(self, method: concept_proto.Type.Req):
method.label = self.get_label()
request = transaction_proto.Transaction.Req()
request.type_req.CopyFrom(method)
return self._transaction._execute(request).type_res
def __str__(self):
return type(self).__name__ + "[label:" + self.get_label() + "]"
def __eq__(self, other):
if other is self:
return True
if not other or type(self) != type(other):
return False
return self._transaction is other._transaction and self.get_label() == other.get_label()
def __hash__(self):
return self._hash
| 37.597484 | 160 | 0.698227 | 794 | 5,978 | 4.979849 | 0.18136 | 0.088012 | 0.080931 | 0.048053 | 0.500759 | 0.445372 | 0.433738 | 0.352807 | 0.326252 | 0.305008 | 0 | 0.001267 | 0.208096 | 5,978 | 158 | 161 | 37.835443 | 0.833967 | 0.125795 | 0 | 0.546296 | 0 | 0 | 0.021702 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.231481 | false | 0 | 0.055556 | 0.101852 | 0.527778 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
32bde996a0268dc6620edc9ff28257bebe3d7904 | 2,702 | py | Python | users/models.py | sevenstar77/coin_dev | 2dd898d15fcb5f7bf4cfd37d5601b23b36526f3f | [
"MIT"
] | null | null | null | users/models.py | sevenstar77/coin_dev | 2dd898d15fcb5f7bf4cfd37d5601b23b36526f3f | [
"MIT"
] | null | null | null | users/models.py | sevenstar77/coin_dev | 2dd898d15fcb5f7bf4cfd37d5601b23b36526f3f | [
"MIT"
] | null | null | null | from django.db import models
from .auth.custom_user_model import AbstractBaseUser
from django.utils.translation import ugettext_lazy as _
# Create your models here.
class Usermaster(AbstractBaseUser):
user_no = models.IntegerField(db_column='userno', primary_key=True) # Field name made lowercase.
user_status_code = models.CharField(db_column='userstatuscode', max_length=10) # Field name made lowercase.
name = models.CharField(db_column='name', max_length=100) # Field name made lowercase.
id = models.CharField(db_column='id', max_length=100, blank=True, null=True) # Field name made lowercase.
user_password = models.CharField(db_column='userpassword', max_length=1000, blank=True, null=True) # Field name made lowercase.
gender = models.CharField(db_column='gender', max_length=1, blank=True, null=True) # Field name made lowercase.
mobile_phone_no = models.CharField(db_column='mobilephoneno', max_length=30, blank=True, null=True) # Field name made lowercase.
email_address = models.CharField(db_column='emailaddress', max_length=100, blank=True, null=True) # Field name made lowercase.
is_email_receive = models.CharField(db_column='isemailreceive', max_length=5) # Field name made lowercase.
enter_join_time = models.DateTimeField(db_column='enterjointime') # Field name made lowercase.
last_update_uno = models.IntegerField(db_column='lastupdateuno') # Field name made lowercase.
last_update_time = models.DateTimeField(db_column='lastupdatetime') # Field name made lowercase.
USERNAME_FIELD = 'user_no'
REQUIRED_FIELDS = []
temp_password = None
class Meta:
managed = False
db_table = 'usermaster'
#verbose_name = _('user')
#verbose_name_plural = _('users')
# class Usermaster(models.Model):
# userno = models.IntegerField(blank=True, null=True)
# userstatuscode = models.CharField(max_length=10, blank=True, null=True)
# name = models.CharField(max_length=100)
# id = models.CharField(max_length=100)
# userpassword = models.CharField(max_length=1000, blank=True, null=True)
# gender = models.CharField(max_length=1, blank=True, null=True)
# mobilephoneno = models.CharField(max_length=30, blank=True, null=True)
# emailaddress = models.CharField(max_length=100, blank=True, null=True)
# isemailreceive = models.CharField(max_length=5)
# enterjointime = models.DateTimeField()
# lastupdateuno = models.IntegerField(blank=True, null=True)
# lastupdatetime = models.DateTimeField()
#
# class Meta:
# managed = False
# db_table = 'usermaster'
| 55.142857 | 133 | 0.714286 | 331 | 2,702 | 5.652568 | 0.241692 | 0.128274 | 0.083378 | 0.141101 | 0.396579 | 0.326563 | 0.236772 | 0.11705 | 0.054516 | 0.054516 | 0 | 0.017133 | 0.179127 | 2,702 | 48 | 134 | 56.291667 | 0.82642 | 0.451887 | 0 | 0 | 0 | 0 | 0.096685 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.090909 | 0.136364 | 0 | 0.909091 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
0881002a225724173e0de53b673b6b9379409680 | 1,496 | py | Python | human_eval/d98453f8-b46f-43c1-9322-7de672335b09.py | LaudateCorpus1/code-align-evals-data | 97446d992c3785d6605f1500b2c9b95d042e7b9c | [
"MIT"
] | 3 | 2021-07-29T23:40:15.000Z | 2021-08-12T10:18:09.000Z | human_eval/d98453f8-b46f-43c1-9322-7de672335b09.py | openai/code-align-evals-data | 97446d992c3785d6605f1500b2c9b95d042e7b9c | [
"MIT"
] | 1 | 2021-09-19T06:44:15.000Z | 2021-09-19T06:44:15.000Z | human_eval/d98453f8-b46f-43c1-9322-7de672335b09.py | LaudateCorpus1/code-align-evals-data | 97446d992c3785d6605f1500b2c9b95d042e7b9c | [
"MIT"
] | 1 | 2021-09-19T06:44:03.000Z | 2021-09-19T06:44:03.000Z | ENTRY_POINT = 'maximum'
#[PROMPT]
def maximum(arr, k):
"""
Given an array arr of integers and a positive integer k, return a sorted list
of length k with the maximum k numbers in arr.
Example 1:
Input: arr = [-3, -4, 5], k = 3
Output: [-4, -3, 5]
Example 2:
Input: arr = [4, -4, 4], k = 2
Output: [4, 4]
Example 3:
Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1
Output: [2]
Note:
1. The length of the array will be in the range of [1, 1000].
2. The elements in the array will be in the range of [-1000, 1000].
3. 0 <= k <= len(arr)
"""
#[SOLUTION]
if k == 0:
return []
arr.sort()
ans = arr[-k:]
return ans
#[CHECK]
def check(candidate):
# Check some simple cases
assert candidate([-3, -4, 5], 3) == [-4, -3, 5]
assert candidate([4, -4, 4], 2) == [4, 4]
assert candidate([-3, 2, 1, 2, -1, -2, 1], 1) == [2]
assert candidate([123, -123, 20, 0 , 1, 2, -3], 3) == [2, 20, 123]
assert candidate([-123, 20, 0 , 1, 2, -3], 4) == [0, 1, 2, 20]
assert candidate([5, 15, 0, 3, -13, -8, 0], 7) == [-13, -8, 0, 0, 3, 5, 15]
assert candidate([-1, 0, 2, 5, 3, -10], 2) == [3, 5]
assert candidate([1, 0, 5, -7], 1) == [5]
assert candidate([4, -4], 2) == [-4, 4]
assert candidate([-10, 10], 2) == [-10, 10]
# Check some edge cases that are easy to work out by hand.
assert candidate([1, 2, 3, -23, 243, -400, 0], 0) == []
| 28.226415 | 82 | 0.495321 | 253 | 1,496 | 2.924901 | 0.272727 | 0.222973 | 0.016216 | 0.021622 | 0.212162 | 0.167568 | 0.143243 | 0.07027 | 0 | 0 | 0 | 0.155106 | 0.30615 | 1,496 | 52 | 83 | 28.769231 | 0.557803 | 0.415107 | 0 | 0 | 0 | 0 | 0.008772 | 0 | 0 | 0 | 0 | 0 | 0.578947 | 1 | 0.105263 | false | 0 | 0 | 0 | 0.210526 | 0 | 0 | 0 | 0 | null | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
0881713ac0cf6199a821aecf03c97c7e5dfac7ed | 2,006 | py | Python | utils.py | christiankuhl/VortexDynamics | 97b96a6231aacb3d0f1e74fda52457bafb833964 | [
"MIT"
] | null | null | null | utils.py | christiankuhl/VortexDynamics | 97b96a6231aacb3d0f1e74fda52457bafb833964 | [
"MIT"
] | null | null | null | utils.py | christiankuhl/VortexDynamics | 97b96a6231aacb3d0f1e74fda52457bafb833964 | [
"MIT"
] | null | null | null | import numpy as np
import math
from functools import wraps
from itertools import chain, combinations, tee
def star_configuration(r, Gamma, axes, centralGamma=None):
"""
Returns a "star-shaped" configuration of vortices in the following way:
The vortices with strength Gamma_i are placed on the x-axis, with distance
r_i to the origin and the whole configuration is rotated onto the n axes
of a regular n-gon. If the parameter centralGamma is supplied, an additional
vortex is placed at the origin with strength centralGamma.
"""
n = axes
Gamma = np.array(list(Gamma)*n)
x0 = np.array([[rho*math.cos(k*2*math.pi/n), rho*math.sin(k*2*math.pi/n)]
for k in range(n) for rho in r]).flatten()
if centralGamma:
x0 = np.append(x0, [0, 0])
Gamma = np.append(Gamma, [centralGamma])
return x0, Gamma
def scatterList(z):
"""
scatterList reshapes the solution vector z of the N-vortex ODE for easy 2d plotting.
"""
k = int(len(z)/2)
return [z[2*j] for j in range(k)], [z[2*j+1] for j in range(k)]
def vectorized(f):
@wraps(f)
def wrapper(self, *args, **kwargs):
def stripped_f(*args, **kwargs):
return f(self, *args, **kwargs)
ufunc = np.vectorize(stripped_f)
return ufunc(*args, **kwargs)
return wrapper
def symplectic(i, j):
if i % 2 == 1:
if i == j + 1:
return 1
else:
if i == j - 1:
return -1
return 0
def pairwise(iterable):
"s -> (s0,s1), (s1,s2), (s2, s3), ..."
a, b = tee(iterable)
next(b, None)
return zip(a, b)
def powerset(iterable):
"powerset([1,2,3]) --> () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)"
s = list(iterable)
return chain.from_iterable(combinations(s, r) for r in range(2,len(s)+1))
def rotate(z, eps):
return np.array([z[j:j+2] @ [[math.cos(eps), -math.sin(eps)], [math.sin(eps), math.cos(eps)]] for j in range(0, len(z), 2)]).flatten() | 33.433333 | 138 | 0.597707 | 324 | 2,006 | 3.682099 | 0.333333 | 0.029338 | 0.015088 | 0.027661 | 0.088852 | 0.020117 | 0 | 0 | 0 | 0 | 0 | 0.030708 | 0.25324 | 2,006 | 60 | 138 | 33.433333 | 0.765688 | 0.270688 | 0 | 0 | 0 | 0.023256 | 0.066447 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.209302 | false | 0 | 0.093023 | 0.046512 | 0.55814 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
08932374577f011f08ad1e936d58780c1d39dfbc | 235 | py | Python | frontend/src/gbuilder/Core/Device.py | anrl/gini4 | d26649c8c02a1737159e48732cf1ee15ba2a604d | [
"MIT"
] | 3 | 2016-04-21T04:41:52.000Z | 2017-09-01T11:46:31.000Z | frontend/src/gbuilder/Core/Device.py | anrl/gini4 | d26649c8c02a1737159e48732cf1ee15ba2a604d | [
"MIT"
] | null | null | null | frontend/src/gbuilder/Core/Device.py | anrl/gini4 | d26649c8c02a1737159e48732cf1ee15ba2a604d | [
"MIT"
] | 1 | 2020-03-24T09:32:36.000Z | 2020-03-24T09:32:36.000Z | """The logical object of a node"""
from UI.Node import *
class Device(Node):
def __init__(self):
"""
Create a logical side to the node.
"""
Node.__init__(self)
self.connection = []
| 14.6875 | 42 | 0.53617 | 28 | 235 | 4.214286 | 0.642857 | 0.135593 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.344681 | 235 | 15 | 43 | 15.666667 | 0.766234 | 0.268085 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0 | 0.2 | 0 | 0.6 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
089445afa73b1e2a958aa1204b4cc5c9f2eb6918 | 445 | py | Python | rest-api/flask_app/long_task/routes.py | sinedie/Flask-Svelte-Websockets-Nginx-Docker | 76daeec2c76f9f27ca526f53393ab4363020b92b | [
"WTFPL"
] | 4 | 2021-11-21T14:04:15.000Z | 2022-03-20T15:28:14.000Z | rest-api/flask_app/long_task/routes.py | sinedie/Utimate-flask-websocket-template | 76daeec2c76f9f27ca526f53393ab4363020b92b | [
"WTFPL"
] | null | null | null | rest-api/flask_app/long_task/routes.py | sinedie/Utimate-flask-websocket-template | 76daeec2c76f9f27ca526f53393ab4363020b92b | [
"WTFPL"
] | null | null | null | from flask import Blueprint, jsonify
from flask_jwt_extended import fresh_jwt_required
from flask_app.celery_worker import celery_worker
async_task = Blueprint('async_task', __name__, url_prefix="/api/async_task")
@async_task.route('/', methods=['GET'])
@fresh_jwt_required
def long_task():
r = celery_worker.send_task('tasks.longtime_add', kwargs={'x': 1, 'y': 2})
return jsonify({'msg': f'Running long task with id: {r.id}'}), 200 | 31.785714 | 78 | 0.74382 | 68 | 445 | 4.544118 | 0.588235 | 0.116505 | 0.10356 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.01269 | 0.114607 | 445 | 14 | 79 | 31.785714 | 0.771574 | 0 | 0 | 0 | 0 | 0 | 0.190583 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.111111 | false | 0 | 0.333333 | 0 | 0.555556 | 0.222222 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
089f48a0d9adfb0db3d74e5cbbad32b5f84fb954 | 796 | py | Python | servi-bench/benchmarks_old/cpustress/google/nodejs/cpustress_benchmark.py | ServiBench/ReplicationPackage | bfdec842f3789de095f1433fa484e29c255cc20a | [
"Apache-2.0"
] | null | null | null | servi-bench/benchmarks_old/cpustress/google/nodejs/cpustress_benchmark.py | ServiBench/ReplicationPackage | bfdec842f3789de095f1433fa484e29c255cc20a | [
"Apache-2.0"
] | null | null | null | servi-bench/benchmarks_old/cpustress/google/nodejs/cpustress_benchmark.py | ServiBench/ReplicationPackage | bfdec842f3789de095f1433fa484e29c255cc20a | [
"Apache-2.0"
] | null | null | null | import os
from timeit import default_timer as timer
def setup():
os.system('sls deploy')
# TODO: need a harness-supported way of injecting credentials for all sls calls
# os.system('sls deploy --credentials=/path/to/credentials.json')
def pre_execute():
print('needed?')
def execute():
print('executing')
os.system('sls invoke --function google-cpustress-nodejs --data \'{ "level": 2 }\'')
def post_execute():
os.system('cat response.json')
def cleanup():
os.system('sls remove')
def main():
setup()
print('Cold start')
start = timer()
execute()
end = timer()
print(end - start)
print('Warm start')
start = timer()
execute()
end = timer()
print(end - start)
cleanup()
if __name__ == "__main__":
main()
| 19.414634 | 88 | 0.624372 | 101 | 796 | 4.811881 | 0.514851 | 0.082305 | 0.090535 | 0.069959 | 0.176955 | 0.176955 | 0.176955 | 0.176955 | 0.176955 | 0 | 0 | 0.001621 | 0.224874 | 796 | 40 | 89 | 19.9 | 0.786062 | 0.177136 | 0 | 0.285714 | 0 | 0 | 0.214724 | 0.035276 | 0 | 0 | 0 | 0.025 | 0 | 1 | 0.214286 | false | 0 | 0.071429 | 0 | 0.285714 | 0.214286 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
08d443a91cc3abd44fdc82ef7bde48591c30951e | 841 | py | Python | compiler/characterizer/__init__.py | panicmarvin/OpenRAM | abf47bab50adb48337c59b72ccd6023c1999f3fc | [
"BSD-3-Clause"
] | null | null | null | compiler/characterizer/__init__.py | panicmarvin/OpenRAM | abf47bab50adb48337c59b72ccd6023c1999f3fc | [
"BSD-3-Clause"
] | null | null | null | compiler/characterizer/__init__.py | panicmarvin/OpenRAM | abf47bab50adb48337c59b72ccd6023c1999f3fc | [
"BSD-3-Clause"
] | 1 | 2020-01-23T07:12:52.000Z | 2020-01-23T07:12:52.000Z | import os
import debug
from globals import OPTS,find_exe,get_tool
import lib
import delay
import setup_hold
debug.info(2,"Initializing characterizer...")
OPTS.spice_exe = ""
if not OPTS.analytical_delay:
if OPTS.spice_name != "":
OPTS.spice_exe=find_exe(OPTS.spice_name)
if OPTS.spice_exe=="":
debug.error("{0} not found. Unable to perform characterization.".format(OPTS.spice_name),1)
else:
(OPTS.spice_name,OPTS.spice_exe) = get_tool("spice",["xa", "hspice", "ngspice", "ngspice.exe"])
# set the input dir for spice files if using ngspice
if OPTS.spice_name == "ngspice":
os.environ["NGSPICE_INPUT_DIR"] = "{0}".format(OPTS.openram_temp)
if OPTS.spice_exe == "":
debug.error("No recognizable spice version found. Unable to perform characterization.",1)
| 28.033333 | 103 | 0.680143 | 118 | 841 | 4.686441 | 0.415254 | 0.162749 | 0.108499 | 0.05425 | 0.307414 | 0.177215 | 0 | 0 | 0 | 0 | 0 | 0.007342 | 0.19025 | 841 | 29 | 104 | 29 | 0.804699 | 0.059453 | 0 | 0.105263 | 0 | 0 | 0.266242 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0.315789 | 0 | 0.315789 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
3ea50592c03b4df67f676a30fdf69c5ab5ea453d | 1,688 | py | Python | 06-Projects/01-IPC-DataInsights/LogPackage/__init__.py | NguyenQuangBinh803/Python-Heritage | 7da72b2926cefc4903086a1cab7de3a64764d648 | [
"MIT"
] | 1 | 2021-01-10T12:06:26.000Z | 2021-01-10T12:06:26.000Z | 06-Projects/01-IPC-DataInsights/LogPackage/__init__.py | NguyenQuangBinh803/Python-Heritage | 7da72b2926cefc4903086a1cab7de3a64764d648 | [
"MIT"
] | null | null | null | 06-Projects/01-IPC-DataInsights/LogPackage/__init__.py | NguyenQuangBinh803/Python-Heritage | 7da72b2926cefc4903086a1cab7de3a64764d648 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Edward J. C. Ashenbert'
__credits__ = ["Edward J. C. Ashenbert"]
__maintainer__ = "Edward J. C. Ashenbert"
__email__ = "nguyenquangbinh803@gmail.com"
__copyright__ = "Copyright 2021"
__status__ = "Working on deploy Analyzer Design pattern"
__version__ = "2021.06.14"
LogPackageInstanceTemplate = "#!/usr/bin/env python\n\
# -*- coding: utf-8 -*-\n\
\n\
__author__ = 'Edward J. C. Ashenbert'\n\
__credits__ = [\"Edward J. C. Ashenbert\"]\n\
__maintainer__ = \"Edward J. C. Ashenbert\"\n\
__email__ = \"nguyenquangbinh803@gmail.com\"\n\
__copyright__ =\"Copyright 2021\"\n\
__status__ = \"Working on deploy Analyzer Design pattern\"\n\
__version__ = \"2021.06.14\"\n\
\n\
from LogPackage.LogPackage import LogPackageAbstract\n\
\n\
\n\
class LogPackage_%s (LogPackageAbstract):\n\
def __init__(self):\n\
super().__init__()\n\
self.log_level = \"\"\n\
self.log_package_name = \"\"\n\
self.log_package_data = \"\"\n\
\n\
def LogPackageAnalyze(self):\n\
pass"
from LogPackage.LogPackage_imgLib_expStandbyComplete import *
from LogPackage.LogPackage_imgLib_startTrace import *
from LogPackage.LogPackage_imgLib_traceComplete import *
from LogPackage.LogPackage_imgLib_imgOutMemClear import *
from LogPackage.LogPackage_TrexACL_clearImageBuffer import *
from LogPackage.LogPackage_imgLib_initLibrary import *
from LogPackage.LogPackage_imgLib_getConfig import *
from LogPackage.LogPackage_imgLib_makeDMDMirrorAdr import *
from LogPackage.LogPackage_imgLib_expStandby import *
from LogPackage.LogPackage_imgLib_expStart import *
from LogPackage.LogPackage_imgLib_expPostProc import *
| 35.166667 | 61 | 0.751777 | 198 | 1,688 | 5.944444 | 0.313131 | 0.142736 | 0.24469 | 0.254885 | 0.474936 | 0.071368 | 0.071368 | 0 | 0 | 0 | 0 | 0.021651 | 0.124408 | 1,688 | 47 | 62 | 35.914894 | 0.774696 | 0.024882 | 0 | 0.121951 | 0 | 0 | 0.198905 | 0.034672 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.02439 | 0.292683 | 0 | 0.292683 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
3eb0d9beda68ef32de960fd30a5f0571516408c9 | 196 | py | Python | Object_Detection/urls.py | maxpark/YOLOv3-OBJECT-DETECTION-REST-API | 981f7a1cb97e202d6899a63021c3df4a6f53df94 | [
"Apache-2.0"
] | 14 | 2020-11-02T00:31:41.000Z | 2022-03-07T10:59:09.000Z | Object_Detection/urls.py | ILasya/OBJECT-DETECTION-using-YOLOv3 | bfecec4cad53cde053a939fdc03862f93679c74a | [
"Apache-2.0"
] | null | null | null | Object_Detection/urls.py | ILasya/OBJECT-DETECTION-using-YOLOv3 | bfecec4cad53cde053a939fdc03862f93679c74a | [
"Apache-2.0"
] | 3 | 2021-01-06T12:59:25.000Z | 2021-07-03T14:36:56.000Z | from django.conf import settings
from django.views.static import serve
urlpatterns = [
url(r'^Object_Detection/(?P<path>.*)$', serve, {
'document_root': settings.MEDIA_ROOT,
}),
] | 24.5 | 52 | 0.673469 | 24 | 196 | 5.375 | 0.75 | 0.155039 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.173469 | 196 | 8 | 53 | 24.5 | 0.796296 | 0 | 0 | 0 | 0 | 0 | 0.22335 | 0.15736 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.285714 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
3eb33cdac9dd3902919df548acaff5710d51bc1d | 19,725 | py | Python | src/oci/log_analytics/models/log_analytics_source_pattern.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/log_analytics/models/log_analytics_source_pattern.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/log_analytics/models/log_analytics_source_pattern.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel # noqa: F401
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class LogAnalyticsSourcePattern(object):
"""
LogAnalyticsSourcePattern
"""
def __init__(self, **kwargs):
"""
Initializes a new LogAnalyticsSourcePattern object with values from keyword arguments.
The following keyword arguments are supported (corresponding to the getters/setters of this class):
:param converted_text:
The value to assign to the converted_text property of this LogAnalyticsSourcePattern.
:type converted_text: str
:param db_parser_id:
The value to assign to the db_parser_id property of this LogAnalyticsSourcePattern.
:type db_parser_id: int
:param db_pattern_date_time_columns:
The value to assign to the db_pattern_date_time_columns property of this LogAnalyticsSourcePattern.
:type db_pattern_date_time_columns: str
:param db_pattern_date_time_field:
The value to assign to the db_pattern_date_time_field property of this LogAnalyticsSourcePattern.
:type db_pattern_date_time_field: str
:param db_pattern_sequence_column:
The value to assign to the db_pattern_sequence_column property of this LogAnalyticsSourcePattern.
:type db_pattern_sequence_column: str
:param fields:
The value to assign to the fields property of this LogAnalyticsSourcePattern.
:type fields: list[oci.log_analytics.models.LogAnalyticsParserField]
:param is_include:
The value to assign to the is_include property of this LogAnalyticsSourcePattern.
:type is_include: bool
:param is_default:
The value to assign to the is_default property of this LogAnalyticsSourcePattern.
:type is_default: bool
:param pattern_filter:
The value to assign to the pattern_filter property of this LogAnalyticsSourcePattern.
:type pattern_filter: oci.log_analytics.models.LogAnalyticsPatternFilter
:param alias:
The value to assign to the alias property of this LogAnalyticsSourcePattern.
:type alias: str
:param description:
The value to assign to the description property of this LogAnalyticsSourcePattern.
:type description: str
:param is_enabled:
The value to assign to the is_enabled property of this LogAnalyticsSourcePattern.
:type is_enabled: bool
:param pattern_id:
The value to assign to the pattern_id property of this LogAnalyticsSourcePattern.
:type pattern_id: int
:param is_system:
The value to assign to the is_system property of this LogAnalyticsSourcePattern.
:type is_system: bool
:param source_id:
The value to assign to the source_id property of this LogAnalyticsSourcePattern.
:type source_id: int
:param is_agent_warning_suppressed:
The value to assign to the is_agent_warning_suppressed property of this LogAnalyticsSourcePattern.
:type is_agent_warning_suppressed: bool
:param pattern_text:
The value to assign to the pattern_text property of this LogAnalyticsSourcePattern.
:type pattern_text: str
:param pattern_type:
The value to assign to the pattern_type property of this LogAnalyticsSourcePattern.
:type pattern_type: int
:param entity_type:
The value to assign to the entity_type property of this LogAnalyticsSourcePattern.
:type entity_type: list[str]
"""
self.swagger_types = {
'converted_text': 'str',
'db_parser_id': 'int',
'db_pattern_date_time_columns': 'str',
'db_pattern_date_time_field': 'str',
'db_pattern_sequence_column': 'str',
'fields': 'list[LogAnalyticsParserField]',
'is_include': 'bool',
'is_default': 'bool',
'pattern_filter': 'LogAnalyticsPatternFilter',
'alias': 'str',
'description': 'str',
'is_enabled': 'bool',
'pattern_id': 'int',
'is_system': 'bool',
'source_id': 'int',
'is_agent_warning_suppressed': 'bool',
'pattern_text': 'str',
'pattern_type': 'int',
'entity_type': 'list[str]'
}
self.attribute_map = {
'converted_text': 'convertedText',
'db_parser_id': 'dbParserId',
'db_pattern_date_time_columns': 'dbPatternDateTimeColumns',
'db_pattern_date_time_field': 'dbPatternDateTimeField',
'db_pattern_sequence_column': 'dbPatternSequenceColumn',
'fields': 'fields',
'is_include': 'isInclude',
'is_default': 'isDefault',
'pattern_filter': 'patternFilter',
'alias': 'alias',
'description': 'description',
'is_enabled': 'isEnabled',
'pattern_id': 'patternId',
'is_system': 'isSystem',
'source_id': 'sourceId',
'is_agent_warning_suppressed': 'isAgentWarningSuppressed',
'pattern_text': 'patternText',
'pattern_type': 'patternType',
'entity_type': 'entityType'
}
self._converted_text = None
self._db_parser_id = None
self._db_pattern_date_time_columns = None
self._db_pattern_date_time_field = None
self._db_pattern_sequence_column = None
self._fields = None
self._is_include = None
self._is_default = None
self._pattern_filter = None
self._alias = None
self._description = None
self._is_enabled = None
self._pattern_id = None
self._is_system = None
self._source_id = None
self._is_agent_warning_suppressed = None
self._pattern_text = None
self._pattern_type = None
self._entity_type = None
@property
def converted_text(self):
"""
Gets the converted_text of this LogAnalyticsSourcePattern.
The converted text.
:return: The converted_text of this LogAnalyticsSourcePattern.
:rtype: str
"""
return self._converted_text
@converted_text.setter
def converted_text(self, converted_text):
"""
Sets the converted_text of this LogAnalyticsSourcePattern.
The converted text.
:param converted_text: The converted_text of this LogAnalyticsSourcePattern.
:type: str
"""
self._converted_text = converted_text
@property
def db_parser_id(self):
"""
Gets the db_parser_id of this LogAnalyticsSourcePattern.
The parser unique identifier.
:return: The db_parser_id of this LogAnalyticsSourcePattern.
:rtype: int
"""
return self._db_parser_id
@db_parser_id.setter
def db_parser_id(self, db_parser_id):
"""
Sets the db_parser_id of this LogAnalyticsSourcePattern.
The parser unique identifier.
:param db_parser_id: The db_parser_id of this LogAnalyticsSourcePattern.
:type: int
"""
self._db_parser_id = db_parser_id
@property
def db_pattern_date_time_columns(self):
"""
Gets the db_pattern_date_time_columns of this LogAnalyticsSourcePattern.
The date time columns.
:return: The db_pattern_date_time_columns of this LogAnalyticsSourcePattern.
:rtype: str
"""
return self._db_pattern_date_time_columns
@db_pattern_date_time_columns.setter
def db_pattern_date_time_columns(self, db_pattern_date_time_columns):
"""
Sets the db_pattern_date_time_columns of this LogAnalyticsSourcePattern.
The date time columns.
:param db_pattern_date_time_columns: The db_pattern_date_time_columns of this LogAnalyticsSourcePattern.
:type: str
"""
self._db_pattern_date_time_columns = db_pattern_date_time_columns
@property
def db_pattern_date_time_field(self):
"""
Gets the db_pattern_date_time_field of this LogAnalyticsSourcePattern.
The date time field.
:return: The db_pattern_date_time_field of this LogAnalyticsSourcePattern.
:rtype: str
"""
return self._db_pattern_date_time_field
@db_pattern_date_time_field.setter
def db_pattern_date_time_field(self, db_pattern_date_time_field):
"""
Sets the db_pattern_date_time_field of this LogAnalyticsSourcePattern.
The date time field.
:param db_pattern_date_time_field: The db_pattern_date_time_field of this LogAnalyticsSourcePattern.
:type: str
"""
self._db_pattern_date_time_field = db_pattern_date_time_field
@property
def db_pattern_sequence_column(self):
"""
Gets the db_pattern_sequence_column of this LogAnalyticsSourcePattern.
The sequence column.
:return: The db_pattern_sequence_column of this LogAnalyticsSourcePattern.
:rtype: str
"""
return self._db_pattern_sequence_column
@db_pattern_sequence_column.setter
def db_pattern_sequence_column(self, db_pattern_sequence_column):
"""
Sets the db_pattern_sequence_column of this LogAnalyticsSourcePattern.
The sequence column.
:param db_pattern_sequence_column: The db_pattern_sequence_column of this LogAnalyticsSourcePattern.
:type: str
"""
self._db_pattern_sequence_column = db_pattern_sequence_column
@property
def fields(self):
"""
Gets the fields of this LogAnalyticsSourcePattern.
The parser field list.
:return: The fields of this LogAnalyticsSourcePattern.
:rtype: list[oci.log_analytics.models.LogAnalyticsParserField]
"""
return self._fields
@fields.setter
def fields(self, fields):
"""
Sets the fields of this LogAnalyticsSourcePattern.
The parser field list.
:param fields: The fields of this LogAnalyticsSourcePattern.
:type: list[oci.log_analytics.models.LogAnalyticsParserField]
"""
self._fields = fields
@property
def is_include(self):
"""
Gets the is_include of this LogAnalyticsSourcePattern.
A flag indicating if this is source pattern is included.
:return: The is_include of this LogAnalyticsSourcePattern.
:rtype: bool
"""
return self._is_include
@is_include.setter
def is_include(self, is_include):
"""
Sets the is_include of this LogAnalyticsSourcePattern.
A flag indicating if this is source pattern is included.
:param is_include: The is_include of this LogAnalyticsSourcePattern.
:type: bool
"""
self._is_include = is_include
@property
def is_default(self):
"""
Gets the is_default of this LogAnalyticsSourcePattern.
A flag indicating if this is the default source pattern.
:return: The is_default of this LogAnalyticsSourcePattern.
:rtype: bool
"""
return self._is_default
@is_default.setter
def is_default(self, is_default):
"""
Sets the is_default of this LogAnalyticsSourcePattern.
A flag indicating if this is the default source pattern.
:param is_default: The is_default of this LogAnalyticsSourcePattern.
:type: bool
"""
self._is_default = is_default
@property
def pattern_filter(self):
"""
Gets the pattern_filter of this LogAnalyticsSourcePattern.
:return: The pattern_filter of this LogAnalyticsSourcePattern.
:rtype: oci.log_analytics.models.LogAnalyticsPatternFilter
"""
return self._pattern_filter
@pattern_filter.setter
def pattern_filter(self, pattern_filter):
"""
Sets the pattern_filter of this LogAnalyticsSourcePattern.
:param pattern_filter: The pattern_filter of this LogAnalyticsSourcePattern.
:type: oci.log_analytics.models.LogAnalyticsPatternFilter
"""
self._pattern_filter = pattern_filter
@property
def alias(self):
"""
Gets the alias of this LogAnalyticsSourcePattern.
The source pattern alias.
:return: The alias of this LogAnalyticsSourcePattern.
:rtype: str
"""
return self._alias
@alias.setter
def alias(self, alias):
"""
Sets the alias of this LogAnalyticsSourcePattern.
The source pattern alias.
:param alias: The alias of this LogAnalyticsSourcePattern.
:type: str
"""
self._alias = alias
@property
def description(self):
"""
Gets the description of this LogAnalyticsSourcePattern.
The source pattern description.
:return: The description of this LogAnalyticsSourcePattern.
:rtype: str
"""
return self._description
@description.setter
def description(self, description):
"""
Sets the description of this LogAnalyticsSourcePattern.
The source pattern description.
:param description: The description of this LogAnalyticsSourcePattern.
:type: str
"""
self._description = description
@property
def is_enabled(self):
"""
Gets the is_enabled of this LogAnalyticsSourcePattern.
A flag inidcating whether or not the source pattern is enabled.
:return: The is_enabled of this LogAnalyticsSourcePattern.
:rtype: bool
"""
return self._is_enabled
@is_enabled.setter
def is_enabled(self, is_enabled):
"""
Sets the is_enabled of this LogAnalyticsSourcePattern.
A flag inidcating whether or not the source pattern is enabled.
:param is_enabled: The is_enabled of this LogAnalyticsSourcePattern.
:type: bool
"""
self._is_enabled = is_enabled
@property
def pattern_id(self):
"""
Gets the pattern_id of this LogAnalyticsSourcePattern.
The source pattern unique identifier.
:return: The pattern_id of this LogAnalyticsSourcePattern.
:rtype: int
"""
return self._pattern_id
@pattern_id.setter
def pattern_id(self, pattern_id):
"""
Sets the pattern_id of this LogAnalyticsSourcePattern.
The source pattern unique identifier.
:param pattern_id: The pattern_id of this LogAnalyticsSourcePattern.
:type: int
"""
self._pattern_id = pattern_id
@property
def is_system(self):
"""
Gets the is_system of this LogAnalyticsSourcePattern.
The system flag. A value of false denotes a custom, or user
defined object. A value of true denotes a built in object.
:return: The is_system of this LogAnalyticsSourcePattern.
:rtype: bool
"""
return self._is_system
@is_system.setter
def is_system(self, is_system):
"""
Sets the is_system of this LogAnalyticsSourcePattern.
The system flag. A value of false denotes a custom, or user
defined object. A value of true denotes a built in object.
:param is_system: The is_system of this LogAnalyticsSourcePattern.
:type: bool
"""
self._is_system = is_system
@property
def source_id(self):
"""
Gets the source_id of this LogAnalyticsSourcePattern.
The source unique identifier.
:return: The source_id of this LogAnalyticsSourcePattern.
:rtype: int
"""
return self._source_id
@source_id.setter
def source_id(self, source_id):
"""
Sets the source_id of this LogAnalyticsSourcePattern.
The source unique identifier.
:param source_id: The source_id of this LogAnalyticsSourcePattern.
:type: int
"""
self._source_id = source_id
@property
def is_agent_warning_suppressed(self):
"""
Gets the is_agent_warning_suppressed of this LogAnalyticsSourcePattern.
A flag indicating whether or not agent warnings are suppressed for
this source pattern.
:return: The is_agent_warning_suppressed of this LogAnalyticsSourcePattern.
:rtype: bool
"""
return self._is_agent_warning_suppressed
@is_agent_warning_suppressed.setter
def is_agent_warning_suppressed(self, is_agent_warning_suppressed):
"""
Sets the is_agent_warning_suppressed of this LogAnalyticsSourcePattern.
A flag indicating whether or not agent warnings are suppressed for
this source pattern.
:param is_agent_warning_suppressed: The is_agent_warning_suppressed of this LogAnalyticsSourcePattern.
:type: bool
"""
self._is_agent_warning_suppressed = is_agent_warning_suppressed
@property
def pattern_text(self):
"""
Gets the pattern_text of this LogAnalyticsSourcePattern.
The pattern text.
:return: The pattern_text of this LogAnalyticsSourcePattern.
:rtype: str
"""
return self._pattern_text
@pattern_text.setter
def pattern_text(self, pattern_text):
"""
Sets the pattern_text of this LogAnalyticsSourcePattern.
The pattern text.
:param pattern_text: The pattern_text of this LogAnalyticsSourcePattern.
:type: str
"""
self._pattern_text = pattern_text
@property
def pattern_type(self):
"""
Gets the pattern_type of this LogAnalyticsSourcePattern.
The pattern type.
:return: The pattern_type of this LogAnalyticsSourcePattern.
:rtype: int
"""
return self._pattern_type
@pattern_type.setter
def pattern_type(self, pattern_type):
"""
Sets the pattern_type of this LogAnalyticsSourcePattern.
The pattern type.
:param pattern_type: The pattern_type of this LogAnalyticsSourcePattern.
:type: int
"""
self._pattern_type = pattern_type
@property
def entity_type(self):
"""
Gets the entity_type of this LogAnalyticsSourcePattern.
The source entity type.
:return: The entity_type of this LogAnalyticsSourcePattern.
:rtype: list[str]
"""
return self._entity_type
@entity_type.setter
def entity_type(self, entity_type):
"""
Sets the entity_type of this LogAnalyticsSourcePattern.
The source entity type.
:param entity_type: The entity_type of this LogAnalyticsSourcePattern.
:type: list[str]
"""
self._entity_type = entity_type
def __repr__(self):
return formatted_flat_dict(self)
def __eq__(self, other):
if other is None:
return False
return self.__dict__ == other.__dict__
def __ne__(self, other):
return not self == other
| 31.3593 | 245 | 0.657338 | 2,204 | 19,725 | 5.613884 | 0.076225 | 0.046553 | 0.238018 | 0.107492 | 0.721652 | 0.617069 | 0.465611 | 0.36418 | 0.301059 | 0.202861 | 0 | 0.001268 | 0.280101 | 19,725 | 628 | 246 | 31.409236 | 0.87007 | 0.524715 | 0 | 0.101064 | 0 | 0 | 0.123832 | 0.05109 | 0 | 0 | 0 | 0 | 0 | 1 | 0.223404 | false | 0 | 0.010638 | 0.010638 | 0.361702 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
3ec10f0dccc2e24f2ca121b65a01e00ab44d9aa5 | 18,886 | py | Python | pysnmp/Unisphere-Data-DVMRP-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/Unisphere-Data-DVMRP-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/Unisphere-Data-DVMRP-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module Unisphere-Data-DVMRP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Unisphere-Data-DVMRP-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 21:23:44 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint", "SingleValueConstraint")
dvmrpInterfaceEntry, = mibBuilder.importSymbols("DVMRP-STD-MIB", "dvmrpInterfaceEntry")
InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex")
NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance")
NotificationType, MibIdentifier, TimeTicks, IpAddress, Bits, Integer32, iso, Counter64, ObjectIdentity, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32, Counter32, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "MibIdentifier", "TimeTicks", "IpAddress", "Bits", "Integer32", "iso", "Counter64", "ObjectIdentity", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32", "Counter32", "Unsigned32")
TextualConvention, DisplayString, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "RowStatus")
usDataMibs, = mibBuilder.importSymbols("Unisphere-Data-MIBs", "usDataMibs")
usdDvmrpMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44))
usdDvmrpMIB.setRevisions(('2001-05-11 15:46',))
if mibBuilder.loadTexts: usdDvmrpMIB.setLastUpdated('200105111546Z')
if mibBuilder.loadTexts: usdDvmrpMIB.setOrganization('Unisphere Networks, Inc.')
usdDvmrpMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1))
usdDvmrp = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1))
usdDvmrpScalar = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 1))
usdDvmrpAdminState = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disable", 0), ("enable", 1)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: usdDvmrpAdminState.setStatus('current')
usdDvmrpMcastAdminState = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disable", 0), ("enable", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdDvmrpMcastAdminState.setStatus('current')
usdDvmrpRouteHogNotification = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 1, 3), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: usdDvmrpRouteHogNotification.setStatus('current')
usdDvmrpRouteLimit = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 1, 4), Integer32()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: usdDvmrpRouteLimit.setStatus('current')
usdDvmrpS32PrunesOnly = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disable", 0), ("enable", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdDvmrpS32PrunesOnly.setStatus('current')
usdDvmrpAclDistNbrTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 2), )
if mibBuilder.loadTexts: usdDvmrpAclDistNbrTable.setStatus('current')
usdDvmrpAclDistNbrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 2, 1), ).setIndexNames((0, "Unisphere-Data-DVMRP-MIB", "usdDvmrpAclDistNbrIfIndex"), (0, "Unisphere-Data-DVMRP-MIB", "usdDvmrpAclDistNbrAclListName"))
if mibBuilder.loadTexts: usdDvmrpAclDistNbrEntry.setStatus('current')
usdDvmrpAclDistNbrIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 2, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: usdDvmrpAclDistNbrIfIndex.setStatus('current')
usdDvmrpAclDistNbrAclListName = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 2, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 80)))
if mibBuilder.loadTexts: usdDvmrpAclDistNbrAclListName.setStatus('current')
usdDvmrpAclDistNbrDistance = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)).clone(1)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: usdDvmrpAclDistNbrDistance.setStatus('current')
usdDvmrpAclDistNbrNbrListName = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 2, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 80))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: usdDvmrpAclDistNbrNbrListName.setStatus('current')
usdDvmrpAclDistNbrStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 2, 1, 5), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: usdDvmrpAclDistNbrStatus.setStatus('current')
usdDvmrpLocalAddrTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 3), )
if mibBuilder.loadTexts: usdDvmrpLocalAddrTable.setStatus('current')
usdDvmrpLocalAddrTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 3, 1), ).setIndexNames((0, "Unisphere-Data-DVMRP-MIB", "usdDvmrpLocalAddrIfIndex"), (0, "Unisphere-Data-DVMRP-MIB", "usdDvmrpLocalAddrAddrOrIfIndex"))
if mibBuilder.loadTexts: usdDvmrpLocalAddrTableEntry.setStatus('current')
usdDvmrpLocalAddrIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 3, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: usdDvmrpLocalAddrIfIndex.setStatus('current')
usdDvmrpLocalAddrAddrOrIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 3, 1, 2), Unsigned32())
if mibBuilder.loadTexts: usdDvmrpLocalAddrAddrOrIfIndex.setStatus('current')
usdDvmrpLocalAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 3, 1, 3), IpAddress()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdDvmrpLocalAddrMask.setStatus('current')
usdDvmrpSummaryAddrTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 4), )
if mibBuilder.loadTexts: usdDvmrpSummaryAddrTable.setStatus('current')
usdDvmrpSummaryAddrTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 4, 1), ).setIndexNames((0, "Unisphere-Data-DVMRP-MIB", "usdDvmrpSummaryAddrIfIndex"), (0, "Unisphere-Data-DVMRP-MIB", "usdDvmrpSummaryAddrAddress"), (0, "Unisphere-Data-DVMRP-MIB", "usdDvmrpSummaryAddrMask"))
if mibBuilder.loadTexts: usdDvmrpSummaryAddrTableEntry.setStatus('current')
usdDvmrpSummaryAddrIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 4, 1, 1), InterfaceIndex())
if mibBuilder.loadTexts: usdDvmrpSummaryAddrIfIndex.setStatus('current')
usdDvmrpSummaryAddrAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 4, 1, 2), IpAddress())
if mibBuilder.loadTexts: usdDvmrpSummaryAddrAddress.setStatus('current')
usdDvmrpSummaryAddrMask = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 4, 1, 3), IpAddress())
if mibBuilder.loadTexts: usdDvmrpSummaryAddrMask.setStatus('current')
usdDvmrpSummaryAddrCost = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 4, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 32)).clone(1)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: usdDvmrpSummaryAddrCost.setStatus('current')
usdDvmrpSummaryAddrStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 4, 1, 5), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: usdDvmrpSummaryAddrStatus.setStatus('current')
usdDvmrpInterfaceTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 5), )
if mibBuilder.loadTexts: usdDvmrpInterfaceTable.setStatus('current')
usdDvmrpInterfaceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 5, 1), )
dvmrpInterfaceEntry.registerAugmentions(("Unisphere-Data-DVMRP-MIB", "usdDvmrpInterfaceEntry"))
usdDvmrpInterfaceEntry.setIndexNames(*dvmrpInterfaceEntry.getIndexNames())
if mibBuilder.loadTexts: usdDvmrpInterfaceEntry.setStatus('current')
usdDvmrpInterfaceAutoSummary = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 5, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disable", 0), ("enable", 1)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: usdDvmrpInterfaceAutoSummary.setStatus('current')
usdDvmrpInterfaceMetricOffsetOut = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 5, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: usdDvmrpInterfaceMetricOffsetOut.setStatus('current')
usdDvmrpInterfaceMetricOffsetIn = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 5, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 31)).clone(1)).setMaxAccess("readcreate")
if mibBuilder.loadTexts: usdDvmrpInterfaceMetricOffsetIn.setStatus('current')
usdDvmrpInterfaceAdminState = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 5, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disable", 0), ("enable", 1)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: usdDvmrpInterfaceAdminState.setStatus('current')
usdDvmrpPruneTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 6), )
if mibBuilder.loadTexts: usdDvmrpPruneTable.setStatus('current')
usdDvmrpPruneEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 6, 1), ).setIndexNames((0, "Unisphere-Data-DVMRP-MIB", "usdDvmrpPruneGroup"), (0, "Unisphere-Data-DVMRP-MIB", "usdDvmrpPruneSource"), (0, "Unisphere-Data-DVMRP-MIB", "usdDvmrpPruneSourceMask"))
if mibBuilder.loadTexts: usdDvmrpPruneEntry.setStatus('current')
usdDvmrpPruneGroup = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 6, 1, 1), IpAddress())
if mibBuilder.loadTexts: usdDvmrpPruneGroup.setStatus('current')
usdDvmrpPruneSource = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 6, 1, 2), IpAddress())
if mibBuilder.loadTexts: usdDvmrpPruneSource.setStatus('current')
usdDvmrpPruneSourceMask = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 6, 1, 3), IpAddress())
if mibBuilder.loadTexts: usdDvmrpPruneSourceMask.setStatus('current')
usdDvmrpPruneIIFIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 6, 1, 4), InterfaceIndex()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdDvmrpPruneIIFIfIndex.setStatus('current')
usdDvmrpPruneUpTime = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 6, 1, 5), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdDvmrpPruneUpTime.setStatus('current')
usdDvmrpSrcGrpOifTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 7), )
if mibBuilder.loadTexts: usdDvmrpSrcGrpOifTable.setStatus('current')
usdDvmrpSrcGrpOifEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 7, 1), ).setIndexNames((0, "Unisphere-Data-DVMRP-MIB", "usdDvmrpSrcGrpOifGroup"), (0, "Unisphere-Data-DVMRP-MIB", "usdDvmrpSrcGrpOifSource"), (0, "Unisphere-Data-DVMRP-MIB", "usdDvmrpSrcGrpOifSourceMask"), (0, "Unisphere-Data-DVMRP-MIB", "usdDvmrpSrcGrpOifOIFIfIndex"))
if mibBuilder.loadTexts: usdDvmrpSrcGrpOifEntry.setStatus('current')
usdDvmrpSrcGrpOifGroup = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 7, 1, 1), IpAddress())
if mibBuilder.loadTexts: usdDvmrpSrcGrpOifGroup.setStatus('current')
usdDvmrpSrcGrpOifSource = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 7, 1, 2), IpAddress())
if mibBuilder.loadTexts: usdDvmrpSrcGrpOifSource.setStatus('current')
usdDvmrpSrcGrpOifSourceMask = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 7, 1, 3), IpAddress())
if mibBuilder.loadTexts: usdDvmrpSrcGrpOifSourceMask.setStatus('current')
usdDvmrpSrcGrpOifOIFIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 7, 1, 4), InterfaceIndex())
if mibBuilder.loadTexts: usdDvmrpSrcGrpOifOIFIfIndex.setStatus('current')
usdDvmrpSrcGrpOifOIFPruned = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 7, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("false", 0), ("true", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdDvmrpSrcGrpOifOIFPruned.setStatus('current')
usdDvmrpSrcGrpOifOIFDnTTL = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 7, 1, 6), TimeTicks()).setMaxAccess("readonly")
if mibBuilder.loadTexts: usdDvmrpSrcGrpOifOIFDnTTL.setStatus('current')
usdDvmrpTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 0))
usdDvmrpRouteHogNotificationTrap = NotificationType((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 1, 1, 0, 1))
if mibBuilder.loadTexts: usdDvmrpRouteHogNotificationTrap.setStatus('current')
usdDvmrpConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 4))
usdDvmrpCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 4, 1))
usdDvmrpGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 4, 2))
usdDvmrpCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 4, 1, 1)).setObjects(("Unisphere-Data-DVMRP-MIB", "usdDvmrpBaseGroup"), ("Unisphere-Data-DVMRP-MIB", "usdDvmrpAclDistNbrGroup"), ("Unisphere-Data-DVMRP-MIB", "usdDvmrpInterfaceGroup"), ("Unisphere-Data-DVMRP-MIB", "usdDvmrpSourceGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usdDvmrpCompliance = usdDvmrpCompliance.setStatus('current')
usdDvmrpBaseGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 4, 2, 1)).setObjects(("Unisphere-Data-DVMRP-MIB", "usdDvmrpAdminState"), ("Unisphere-Data-DVMRP-MIB", "usdDvmrpMcastAdminState"), ("Unisphere-Data-DVMRP-MIB", "usdDvmrpRouteHogNotification"), ("Unisphere-Data-DVMRP-MIB", "usdDvmrpRouteLimit"), ("Unisphere-Data-DVMRP-MIB", "usdDvmrpS32PrunesOnly"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usdDvmrpBaseGroup = usdDvmrpBaseGroup.setStatus('current')
usdDvmrpAclDistNbrGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 4, 2, 2)).setObjects(("Unisphere-Data-DVMRP-MIB", "usdDvmrpAclDistNbrDistance"), ("Unisphere-Data-DVMRP-MIB", "usdDvmrpAclDistNbrNbrListName"), ("Unisphere-Data-DVMRP-MIB", "usdDvmrpAclDistNbrStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usdDvmrpAclDistNbrGroup = usdDvmrpAclDistNbrGroup.setStatus('current')
usdDvmrpInterfaceGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 4, 2, 3)).setObjects(("Unisphere-Data-DVMRP-MIB", "usdDvmrpLocalAddrMask"), ("Unisphere-Data-DVMRP-MIB", "usdDvmrpSummaryAddrCost"), ("Unisphere-Data-DVMRP-MIB", "usdDvmrpSummaryAddrStatus"), ("Unisphere-Data-DVMRP-MIB", "usdDvmrpInterfaceAutoSummary"), ("Unisphere-Data-DVMRP-MIB", "usdDvmrpInterfaceMetricOffsetOut"), ("Unisphere-Data-DVMRP-MIB", "usdDvmrpInterfaceMetricOffsetIn"), ("Unisphere-Data-DVMRP-MIB", "usdDvmrpInterfaceAdminState"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usdDvmrpInterfaceGroup = usdDvmrpInterfaceGroup.setStatus('current')
usdDvmrpSourceGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 4, 2, 4)).setObjects(("Unisphere-Data-DVMRP-MIB", "usdDvmrpPruneIIFIfIndex"), ("Unisphere-Data-DVMRP-MIB", "usdDvmrpPruneUpTime"), ("Unisphere-Data-DVMRP-MIB", "usdDvmrpSrcGrpOifOIFPruned"), ("Unisphere-Data-DVMRP-MIB", "usdDvmrpSrcGrpOifOIFDnTTL"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usdDvmrpSourceGroup = usdDvmrpSourceGroup.setStatus('current')
usdDvmrpNotificationGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 44, 4, 2, 8)).setObjects(("Unisphere-Data-DVMRP-MIB", "usdDvmrpRouteHogNotificationTrap"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
usdDvmrpNotificationGroup = usdDvmrpNotificationGroup.setStatus('current')
mibBuilder.exportSymbols("Unisphere-Data-DVMRP-MIB", usdDvmrpSrcGrpOifOIFIfIndex=usdDvmrpSrcGrpOifOIFIfIndex, usdDvmrpInterfaceAdminState=usdDvmrpInterfaceAdminState, usdDvmrpRouteHogNotification=usdDvmrpRouteHogNotification, usdDvmrp=usdDvmrp, usdDvmrpS32PrunesOnly=usdDvmrpS32PrunesOnly, usdDvmrpLocalAddrTableEntry=usdDvmrpLocalAddrTableEntry, usdDvmrpLocalAddrIfIndex=usdDvmrpLocalAddrIfIndex, usdDvmrpSrcGrpOifGroup=usdDvmrpSrcGrpOifGroup, usdDvmrpAclDistNbrStatus=usdDvmrpAclDistNbrStatus, usdDvmrpSummaryAddrCost=usdDvmrpSummaryAddrCost, usdDvmrpPruneSourceMask=usdDvmrpPruneSourceMask, usdDvmrpScalar=usdDvmrpScalar, usdDvmrpLocalAddrMask=usdDvmrpLocalAddrMask, usdDvmrpAclDistNbrTable=usdDvmrpAclDistNbrTable, usdDvmrpMIB=usdDvmrpMIB, usdDvmrpInterfaceAutoSummary=usdDvmrpInterfaceAutoSummary, usdDvmrpInterfaceTable=usdDvmrpInterfaceTable, usdDvmrpSrcGrpOifOIFDnTTL=usdDvmrpSrcGrpOifOIFDnTTL, usdDvmrpAdminState=usdDvmrpAdminState, usdDvmrpConformance=usdDvmrpConformance, usdDvmrpAclDistNbrEntry=usdDvmrpAclDistNbrEntry, usdDvmrpGroups=usdDvmrpGroups, usdDvmrpNotificationGroup=usdDvmrpNotificationGroup, usdDvmrpPruneEntry=usdDvmrpPruneEntry, usdDvmrpPruneUpTime=usdDvmrpPruneUpTime, usdDvmrpTraps=usdDvmrpTraps, usdDvmrpRouteLimit=usdDvmrpRouteLimit, usdDvmrpInterfaceGroup=usdDvmrpInterfaceGroup, usdDvmrpSummaryAddrTable=usdDvmrpSummaryAddrTable, usdDvmrpSrcGrpOifOIFPruned=usdDvmrpSrcGrpOifOIFPruned, usdDvmrpInterfaceEntry=usdDvmrpInterfaceEntry, usdDvmrpPruneTable=usdDvmrpPruneTable, usdDvmrpBaseGroup=usdDvmrpBaseGroup, usdDvmrpSourceGroup=usdDvmrpSourceGroup, usdDvmrpSummaryAddrAddress=usdDvmrpSummaryAddrAddress, usdDvmrpInterfaceMetricOffsetIn=usdDvmrpInterfaceMetricOffsetIn, usdDvmrpSummaryAddrIfIndex=usdDvmrpSummaryAddrIfIndex, PYSNMP_MODULE_ID=usdDvmrpMIB, usdDvmrpLocalAddrTable=usdDvmrpLocalAddrTable, usdDvmrpAclDistNbrAclListName=usdDvmrpAclDistNbrAclListName, usdDvmrpSrcGrpOifSourceMask=usdDvmrpSrcGrpOifSourceMask, usdDvmrpSummaryAddrMask=usdDvmrpSummaryAddrMask, usdDvmrpSrcGrpOifEntry=usdDvmrpSrcGrpOifEntry, usdDvmrpCompliances=usdDvmrpCompliances, usdDvmrpCompliance=usdDvmrpCompliance, usdDvmrpPruneSource=usdDvmrpPruneSource, usdDvmrpPruneIIFIfIndex=usdDvmrpPruneIIFIfIndex, usdDvmrpMcastAdminState=usdDvmrpMcastAdminState, usdDvmrpSrcGrpOifSource=usdDvmrpSrcGrpOifSource, usdDvmrpAclDistNbrIfIndex=usdDvmrpAclDistNbrIfIndex, usdDvmrpAclDistNbrDistance=usdDvmrpAclDistNbrDistance, usdDvmrpAclDistNbrGroup=usdDvmrpAclDistNbrGroup, usdDvmrpMIBObjects=usdDvmrpMIBObjects, usdDvmrpSrcGrpOifTable=usdDvmrpSrcGrpOifTable, usdDvmrpLocalAddrAddrOrIfIndex=usdDvmrpLocalAddrAddrOrIfIndex, usdDvmrpAclDistNbrNbrListName=usdDvmrpAclDistNbrNbrListName, usdDvmrpSummaryAddrStatus=usdDvmrpSummaryAddrStatus, usdDvmrpInterfaceMetricOffsetOut=usdDvmrpInterfaceMetricOffsetOut, usdDvmrpSummaryAddrTableEntry=usdDvmrpSummaryAddrTableEntry, usdDvmrpPruneGroup=usdDvmrpPruneGroup, usdDvmrpRouteHogNotificationTrap=usdDvmrpRouteHogNotificationTrap)
| 133 | 2,968 | 0.76787 | 2,054 | 18,886 | 7.059396 | 0.09445 | 0.010069 | 0.013655 | 0.016552 | 0.362621 | 0.304414 | 0.241034 | 0.218828 | 0.211517 | 0.211517 | 0 | 0.075205 | 0.082601 | 18,886 | 141 | 2,969 | 133.943262 | 0.761688 | 0.018109 | 0 | 0.045113 | 0 | 0 | 0.170003 | 0.098193 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.067669 | 0 | 0.067669 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
3ecd3006317b85b7553532346bd26d33d3ca4a09 | 3,568 | py | Python | src/rogerthat/to/messaging/jsmfr.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | src/rogerthat/to/messaging/jsmfr.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | src/rogerthat/to/messaging/jsmfr.py | goubertbrent/oca-backend | b9f59cc02568aecb55d4b54aec05245790ea25fd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# @@license_version:1.7@@
from mcfw.properties import unicode_property, typed_property, object_factory, unicode_list_property, bool_property, \
long_property
from rogerthat.models.properties.forms import FormResult
from rogerthat.to.messaging import MessageTO
from rogerthat.to.messaging.flow import FLOW_STEP_MAPPING, MessageType
from rogerthat.to.messaging.forms import FormMessageTO
from rogerthat.to.system import LogErrorRequestTO
class Step(object_factory):
step_type = unicode_property('step_type')
def __init__(self):
super(Step, self).__init__('step_type', FLOW_STEP_MAPPING, MessageType)
class JsMessageFlowMemberRunTO(object):
parent_message_key = unicode_property('1')
message_flow_run_id = unicode_property('2')
sender = unicode_property('3')
steps = typed_property('4', Step(), True)
hashed_tag = unicode_property('5') # when flow started by service menu item press: hashed_tag of item
service_action = unicode_property('6') # when flow started by QR scan: action of QR code
flow_params = unicode_property('7')
class MessageFlowMemberResultRequestTO(object):
flush_id = unicode_property('1')
end_id = unicode_property('2')
run = typed_property('3', JsMessageFlowMemberRunTO)
results_email = bool_property('4')
email_admins = bool_property('5')
emails = unicode_list_property('6')
message_flow_name = unicode_property('7')
timestamp = long_property('8')
class MessageFlowMemberResultResponseTO(object):
pass
class MessageFlowFinishedRequestTO(object):
parent_message_key = unicode_property('1')
message_flow_run_id = unicode_property('2')
end_id = unicode_property('3')
class MessageFlowFinishedResponseTO(object):
pass
class MessageFlowErrorRequestTO(LogErrorRequestTO):
jsCommand = unicode_property('51')
stackTrace = unicode_property('52')
class MessageFlowErrorResponseTO(object):
pass
class NewMessageType(object):
MESSAGE = 1
FORM_MESSAGE = 2
class NewFlowMessageTO(object_factory):
message_type = long_property('message_type')
def __init__(self):
super(NewFlowMessageTO, self).__init__('message_type', {NewMessageType.MESSAGE: MessageTO,
NewMessageType.FORM_MESSAGE: FormMessageTO},
NewMessageType)
class NewFlowMessageRequestTO(object):
message = typed_property('1', NewFlowMessageTO())
message_flow_run_id = unicode_property('2', default=None)
step_id = unicode_property('3', default=None)
form_result = typed_property('101', FormResult)
class NewFlowMessageResponseTO(object):
pass
class FlowStartedRequestTO(object):
thread_key = unicode_property('1')
service = unicode_property('2')
static_flow_hash = unicode_property('3')
message_flow_run_id = unicode_property('4')
class FlowStartedResponseTO(object):
pass
| 31.857143 | 117 | 0.732904 | 423 | 3,568 | 5.943262 | 0.378251 | 0.131265 | 0.054097 | 0.025457 | 0.096659 | 0.080748 | 0.068417 | 0.055688 | 0.055688 | 0.055688 | 0 | 0.015337 | 0.177691 | 3,568 | 111 | 118 | 32.144144 | 0.841513 | 0.201513 | 0 | 0.171875 | 0 | 0 | 0.026148 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.03125 | false | 0.078125 | 0.09375 | 0 | 0.84375 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
3ed0d926735d2a6218dd76cef238d3eaf891692a | 590 | py | Python | python/connection_timing.py | Russ76/nre_simhuskycontrol | 722faae4174a674c9a157f5ca14f920390da40ae | [
"BSD-3-Clause"
] | 2 | 2020-12-21T10:52:28.000Z | 2021-03-29T12:52:36.000Z | python/connection_timing.py | Russ76/nre_simhuskycontrol | 722faae4174a674c9a157f5ca14f920390da40ae | [
"BSD-3-Clause"
] | 1 | 2019-01-19T17:17:37.000Z | 2019-01-19T17:17:37.000Z | python/connection_timing.py | Russ76/nre_simhuskycontrol | 722faae4174a674c9a157f5ca14f920390da40ae | [
"BSD-3-Clause"
] | 3 | 2017-03-04T14:23:45.000Z | 2021-07-26T03:56:30.000Z | #!/usr/bin/env python
'''
How long does it take to make a connection in ROS
'''
import rospy
import visualization_msgs.msg
import time
def timeconnect():
print "Testing Connetion Time"
topic='visualization_marker'
t1 = time.time()
pub = rospy.Publisher(topic,visualization_msgs.msg.Marker,queue_size=10)
t2 = time.time()
while (pub.get_num_connections() < 1):
pass
te = time.time()
print("%5.2f - %5.2f"%((te-t1)*1e3,(te-t2)*1e3))
rospy.init_node('pubmarker',anonymous=True,disable_signals=True)
timeconnect()
| 19.666667 | 76 | 0.644068 | 80 | 590 | 4.65 | 0.65 | 0.064516 | 0.107527 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.032609 | 0.220339 | 590 | 29 | 77 | 20.344828 | 0.776087 | 0.033898 | 0 | 0 | 0 | 0 | 0.125 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0.066667 | 0.2 | null | null | 0.133333 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
3ed4a5d1dd1ff2d1efae792b65a745fafa7ebbec | 380 | py | Python | fantasy_machine/model/player_model.py | radspork/lou-machine | 4c75c23edc8105dc977167ab4dfeeaecb785a8e1 | [
"MIT"
] | 2 | 2019-03-19T16:49:06.000Z | 2019-03-19T16:51:54.000Z | fantasy_machine/model/player_model.py | radspork/lou-machine | 4c75c23edc8105dc977167ab4dfeeaecb785a8e1 | [
"MIT"
] | null | null | null | fantasy_machine/model/player_model.py | radspork/lou-machine | 4c75c23edc8105dc977167ab4dfeeaecb785a8e1 | [
"MIT"
] | 1 | 2021-02-25T18:43:06.000Z | 2021-02-25T18:43:06.000Z | """
Input: fixtures and their lineups
Output: player projections for those games.
* Contains a projected line of stats
* standard deviation of those projections
ie. troum001 | H | BB | 1B | 2B | 3B | HR |
---------------------------------------------------
proj | 1.23 | 0.76 | 0.88 | 0.27 | 0.18 | 0.11 |
sd | 0.28 | 0.14 | 0.34 | 0.11 | 0.12 | 0.15 | | 42.222222 | 57 | 0.502632 | 56 | 380 | 3.410714 | 0.75 | 0.031414 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.147887 | 0.252632 | 380 | 9 | 58 | 42.222222 | 0.524648 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0 | null | null | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
3ee4aff855f7b4715a87b658d192fd322fe8cb7e | 658 | py | Python | ej7bandera.py | joseluis031/Recursividad | 79b5b2f16615bf905489aaa6cbc87e5dc1635d59 | [
"Apache-2.0"
] | null | null | null | ej7bandera.py | joseluis031/Recursividad | 79b5b2f16615bf905489aaa6cbc87e5dc1635d59 | [
"Apache-2.0"
] | null | null | null | ej7bandera.py | joseluis031/Recursividad | 79b5b2f16615bf905489aaa6cbc87e5dc1635d59 | [
"Apache-2.0"
] | null | null | null | bandera = ["N","B","B","N","A","B","B","N","B","N","N","A","N","N","B","A","A"]
print(bandera)
negro = []
blanco = []
azul = []
def ordenada(bandera):
if len(bandera) > 0:
color = bandera.pop(0)
if color =="N":
negro.append(color)
ordenada(bandera)
elif color == "B":
blanco.append(color)
ordenada(bandera)
elif color == "A":
azul.append(color)
ordenada(bandera)
else:
ordenada = negro + blanco + azul
print(ordenada)
else:
ordenada = negro + blanco + azul
print(ordenada)
ordenada(bandera) | 27.416667 | 79 | 0.477204 | 74 | 658 | 4.243243 | 0.243243 | 0.238854 | 0.143312 | 0.248408 | 0.477707 | 0.477707 | 0.254777 | 0 | 0 | 0 | 0 | 0.004619 | 0.341945 | 658 | 24 | 80 | 27.416667 | 0.720554 | 0 | 0 | 0.416667 | 0 | 0 | 0.030349 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.041667 | false | 0 | 0 | 0 | 0.041667 | 0.125 | 0 | 0 | 0 | null | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
3eea7523dab9a3b6dccd33ca93e27158d2ecfd8b | 187 | py | Python | Leetcode/268. Missing Number/solution1.py | asanoviskhak/Outtalent | c500e8ad498f76d57eb87a9776a04af7bdda913d | [
"MIT"
] | 51 | 2020-07-12T21:27:47.000Z | 2022-02-11T19:25:36.000Z | Leetcode/268. Missing Number/solution1.py | CrazySquirrel/Outtalent | 8a10b23335d8e9f080e5c39715b38bcc2916ff00 | [
"MIT"
] | null | null | null | Leetcode/268. Missing Number/solution1.py | CrazySquirrel/Outtalent | 8a10b23335d8e9f080e5c39715b38bcc2916ff00 | [
"MIT"
] | 32 | 2020-07-27T13:54:24.000Z | 2021-12-25T18:12:50.000Z | class Solution:
def missingNumber(self, nums: List[int]) -> int:
result = len(nums)
for i in range(len(nums)):
result ^= i ^ nums[i]
return result
| 26.714286 | 52 | 0.545455 | 24 | 187 | 4.25 | 0.625 | 0.137255 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.331551 | 187 | 6 | 53 | 31.166667 | 0.816 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0 | 0 | 0.5 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
411cd9034ce1a11d2888e290f702d934e54c2963 | 1,300 | py | Python | hood/forms.py | kipsang01/theHood | d13e854eeac98b6cb9b53a5308eaa33701103204 | [
"MIT"
] | null | null | null | hood/forms.py | kipsang01/theHood | d13e854eeac98b6cb9b53a5308eaa33701103204 | [
"MIT"
] | null | null | null | hood/forms.py | kipsang01/theHood | d13e854eeac98b6cb9b53a5308eaa33701103204 | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.forms import UserCreationForm
from django.forms.models import ModelForm
from django.contrib.auth.models import User
from .models import Post,Neighborhood,Business,Review,Service,Profile
class RegisterUserForm(UserCreationForm):
email = forms.EmailField()
first_name = forms.CharField(max_length=50)
last_name = forms.CharField(max_length=50)
class Meta:
model = User
fields = ('username','first_name','last_name','email','password1','password2')
class newHoodForm(ModelForm):
class Meta:
model = Neighborhood
fields = ('name','location','profile_pic')
class PostForm(ModelForm):
class Meta:
model = Post
fields = ['content','image']
class BusinessForm(ModelForm):
class Meta:
model = Business
fields =['name','type','directions','contact']
class ServiceForm(ModelForm):
class Meta:
model = Service
fields = ['name', 'description','location']
class ReviewForm(ModelForm):
class Meta:
model = Review
fields =['content']
class ProfileForm(ModelForm):
class Meta:
model = Profile
fields = ['profile_pic','about'] | 24.528302 | 86 | 0.631538 | 131 | 1,300 | 6.206107 | 0.366412 | 0.077491 | 0.120541 | 0.169742 | 0.071341 | 0.071341 | 0 | 0 | 0 | 0 | 0 | 0.006244 | 0.260769 | 1,300 | 53 | 87 | 24.528302 | 0.83975 | 0 | 0 | 0.194444 | 0 | 0 | 0.119908 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0.027778 | 0.138889 | 0 | 0.611111 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
411effd2058e36917e4d56a563ae56a1221dfe34 | 2,621 | py | Python | gym_modular/sensors/sensor.py | TimSchneider42/mbpo | 736ba90bbdaddb2a40a6233bc0b78da72235100a | [
"MIT"
] | null | null | null | gym_modular/sensors/sensor.py | TimSchneider42/mbpo | 736ba90bbdaddb2a40a6233bc0b78da72235100a | [
"MIT"
] | null | null | null | gym_modular/sensors/sensor.py | TimSchneider42/mbpo | 736ba90bbdaddb2a40a6233bc0b78da72235100a | [
"MIT"
] | null | null | null | from abc import abstractmethod
from typing import Dict, Optional, TypeVar, Generic, TYPE_CHECKING
import numpy as np
import gym.spaces
if TYPE_CHECKING:
from .. import BaseTask
TaskType = TypeVar("TaskType", bound="BaseTask")
class Sensor(Generic[TaskType]):
"""
An abstract base class for sensors. Sensors produce the observations for the agent.
"""
def __init__(self, **kwargs):
super(Sensor, self).__init__(**kwargs)
self.__task: Optional[TaskType] = None
def initialize(self, task: TaskType) -> Dict[str, gym.spaces.Space]:
"""
Initializes the sensor.
:param task: the gym environment that the sensor should be used for
:return: a dictionary that maps names to the observation spaces that the sensor provides; note that
a sensor might provide multiple independent observations (e.g. linear and angular
velocities), which results in the dictionary containing multiple observation spaces
"""
self.__task: TaskType = task
self._initialize()
return self._get_observation_spaces()
@abstractmethod
def _initialize(self) -> None:
"""
Initializes the concrete instance of the sensor. Must be overwritten by subclasses.
:return: a dictionary that maps names to the observation spaces that the sensor provides
"""
raise NotImplementedError("Method _initialize must be overwritten")
@abstractmethod
def _get_observation_spaces(self) -> Dict[str, gym.spaces.Space]:
raise NotImplementedError("Method _get_observation_space must be overwritten")
@abstractmethod
def reset(self) -> Dict[str, np.ndarray]:
"""
Reset the sensor at the end of the episode.
:return: the observation at the beginning of the episode
"""
raise NotImplementedError("Method reset must be overwritten")
@abstractmethod
def observe(self) -> Dict[str, np.ndarray]:
"""
Calculates the agent's observations for the current time step.
:return: a dictionary that maps observation names to the corresponding values
"""
raise NotImplementedError("Method observe must be overwritten")
@property
def task(self) -> Optional[TaskType]:
"""
Returns the task that the sensor operates on.
:return: the task that the sensor operates on
"""
return self.__task
def __repr__(self):
return type(self).__name__ + "()"
| 34.038961 | 118 | 0.645555 | 295 | 2,621 | 5.613559 | 0.345763 | 0.043478 | 0.039251 | 0.038043 | 0.25785 | 0.131643 | 0.131643 | 0.131643 | 0.088164 | 0.088164 | 0 | 0 | 0.278901 | 2,621 | 76 | 119 | 34.486842 | 0.87619 | 0.4029 | 0 | 0.125 | 0 | 0 | 0.124818 | 0.016058 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.15625 | 0.03125 | 0.53125 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
412a48661f2c296c91a20819333fac5868559165 | 461 | py | Python | FanstiBgs/api/AUser.py | haobin12358/FanstiBgs | 37a9b0d6e7a3f110ba9285a3715fec2e30bdd7d2 | [
"MIT"
] | null | null | null | FanstiBgs/api/AUser.py | haobin12358/FanstiBgs | 37a9b0d6e7a3f110ba9285a3715fec2e30bdd7d2 | [
"MIT"
] | null | null | null | FanstiBgs/api/AUser.py | haobin12358/FanstiBgs | 37a9b0d6e7a3f110ba9285a3715fec2e30bdd7d2 | [
"MIT"
] | null | null | null | from ..control.CUser import CUser
from ..extensions.base_resource import Resource
class AUser(Resource):
def __init__(self):
self.cuser = CUser()
def get(self, user):
apis = {
#'get': self.cuser.hello
}
return apis
def post(self, user):
apis = {
"user_login": self.cuser.user_login,
"user_password_repeat": self.cuser.user_password_repeat
}
return apis | 21.952381 | 67 | 0.579176 | 52 | 461 | 4.923077 | 0.403846 | 0.140625 | 0.09375 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.318872 | 461 | 21 | 68 | 21.952381 | 0.815287 | 0.049892 | 0 | 0.266667 | 0 | 0 | 0.068493 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.2 | false | 0.066667 | 0.133333 | 0 | 0.533333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 2 |
f5b308f7096fdb78cf39a22cb9586933db2e9ca1 | 398 | py | Python | virtual/lib/python3.6/site-packages/pylint/test/input/func_i0022.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 463 | 2015-01-15T08:17:42.000Z | 2022-03-28T15:10:20.000Z | virtual/lib/python3.6/site-packages/pylint/test/input/func_i0022.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 52 | 2015-01-06T02:43:59.000Z | 2022-03-14T11:15:21.000Z | virtual/lib/python3.6/site-packages/pylint/test/input/func_i0022.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 249 | 2015-01-07T22:49:49.000Z | 2022-03-18T02:32:06.000Z | """Deprecated suppression style."""
__revision__ = None
a = 1 # pylint: disable=invalid-name
b = 1 # pylint: disable-msg=invalid-name
# pylint: disable=invalid-name
c = 1
# pylint: enable=invalid-name
# pylint: disable-msg=invalid-name
d = 1
# pylint: enable-msg=invalid-name
# pylint: disable-msg=C0103
e = 1
# pylint: enable-msg=C0103
# pylint: disable=C0103
f = 1
# pylint: enable=C0103
| 17.304348 | 41 | 0.70603 | 58 | 398 | 4.775862 | 0.327586 | 0.151625 | 0.187726 | 0.259928 | 0.389892 | 0 | 0 | 0 | 0 | 0 | 0 | 0.065476 | 0.155779 | 398 | 22 | 42 | 18.090909 | 0.758929 | 0.773869 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
f5ceb5af504110794ddc66b4440d6f91f5fb1a96 | 147 | py | Python | src/whitelist_gatekeeper.py | jasonharrison/gatekeeper | a4efbb2885f71235e9f5ceea2957e2cf2e268f3c | [
"MIT"
] | null | null | null | src/whitelist_gatekeeper.py | jasonharrison/gatekeeper | a4efbb2885f71235e9f5ceea2957e2cf2e268f3c | [
"MIT"
] | 3 | 2018-12-04T16:35:14.000Z | 2019-02-04T23:59:37.000Z | src/whitelist_gatekeeper.py | jasonharrison/gatekeeper | a4efbb2885f71235e9f5ceea2957e2cf2e268f3c | [
"MIT"
] | null | null | null | _.subdomain_matching
_.static_folder
Meta
csrf
csrf_class
csrf_secret
csrf_time_limit
confirm
get_user
_.user
catch_all
bad_gateway
page_not_found
| 10.5 | 20 | 0.891156 | 24 | 147 | 4.875 | 0.833333 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.088435 | 147 | 13 | 21 | 11.307692 | 0.873134 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
f5ece06a232e7b51088ca4fe5365c2364be88b29 | 2,152 | py | Python | zfused_maya/zfused_maya/tool/animation/studiolibrary/packages/mutils/gui/__init__.py | zhoulh0322/zfused_outsource_old | 3d20c1493c3cffd742b10a7db6e0b1f3bb374af8 | [
"Apache-2.0"
] | 1 | 2022-01-14T11:40:35.000Z | 2022-01-14T11:40:35.000Z | zfused_maya/zfused_maya/tool/animation/studiolibrary/packages/mutils/gui/__init__.py | zhoulh0322/zfused_outsource_old | 3d20c1493c3cffd742b10a7db6e0b1f3bb374af8 | [
"Apache-2.0"
] | null | null | null | zfused_maya/zfused_maya/tool/animation/studiolibrary/packages/mutils/gui/__init__.py | zhoulh0322/zfused_outsource_old | 3d20c1493c3cffd742b10a7db6e0b1f3bb374af8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 by Kurt Rathjen. All Rights Reserved.
#
# Permission to use, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permission notice appear in
# supporting documentation, and that the name of Kurt Rathjen
# not be used in advertising or publicity pertaining to distribution
# of the software without specific, written prior permission.
# KURT RATHJEN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# KURT RATHJEN BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
# ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
try:
import maya.OpenMayaUI as omui
except ImportError, e:
print e
from studioqt import QtCore
from studioqt import QtWidgets
try:
from shiboken2 import wrapInstance
except ImportError:
try:
from shiboken import wrapInstance
except ImportError, e:
print e
from .framerangemenu import FrameRangeMenu
from .framerangemenu import showFrameRangeMenu
from .modelpanelwidget import ModelPanelWidget
from .thumbnailcapturedialog import *
def mayaWindow():
"""
Return the Maya main window as a QMainWindow object.
:rtype: QMainWindow
"""
mainWindowPtr = omui.MQtUtil.mainWindow()
return wrapInstance(long(mainWindowPtr), QtWidgets.QMainWindow)
def makeMayaStandaloneWindow(w):
"""
Make a standalone window, though parented under Maya's mainWindow.
The parenting under Maya's mainWindow is done so that the QWidget will
not auto-destroy itself when the instance variable goes out of scope.
"""
# Parent under the main Maya window
w.setParent(mayaWindow())
# Make this widget appear as a standalone window
w.setWindowFlags(QtCore.Qt.Window)
w.raise_()
w.show()
| 33.107692 | 79 | 0.761617 | 285 | 2,152 | 5.747368 | 0.501754 | 0.026862 | 0.017094 | 0.028083 | 0.034188 | 0.034188 | 0 | 0 | 0 | 0 | 0 | 0.002874 | 0.19145 | 2,152 | 64 | 80 | 33.625 | 0.938506 | 0.47816 | 0 | 0.28 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.48 | null | null | 0.08 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 2 |
f5f069d2c446a249b3d7b74a12a02fa6a61cdd51 | 757 | py | Python | src/main.py | yaay1010/pywsl | f00487eb28dff8fb9cb4a31d7d480e8e64854fca | [
"MIT"
] | null | null | null | src/main.py | yaay1010/pywsl | f00487eb28dff8fb9cb4a31d7d480e8e64854fca | [
"MIT"
] | null | null | null | src/main.py | yaay1010/pywsl | f00487eb28dff8fb9cb4a31d7d480e8e64854fca | [
"MIT"
] | null | null | null | import getuser
import os
username = getuser.lookup_username()
def wsl():
while True:
command = input(r""+username+" |> ")
if command != "stop":
if command != "cls":
if command != "brr":
if command != "ide":
print(command)
else:
os.system('' if os.name == 'nt' else 'clear')
else:
print("BRRRRRRRRRRRRRRRRR")
print("BRRRRRRRRRRRRRRRRR")
print("BRRRRRRRRRRRRRRRRR")
print("BRRRRRRRRRRRRRRRRR")
else:
os.system('cls' if os.name == 'nt' else 'clear')
else:
exit(0)
wsl()
| 30.28 | 69 | 0.424042 | 62 | 757 | 5.16129 | 0.419355 | 0.1125 | 0.2625 | 0.43125 | 0.43125 | 0.43125 | 0.14375 | 0 | 0 | 0 | 0 | 0.002439 | 0.458388 | 757 | 24 | 70 | 31.541667 | 0.778049 | 0 | 0 | 0.347826 | 0 | 0 | 0.140026 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.043478 | false | 0 | 0.086957 | 0 | 0.130435 | 0.217391 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
f5f90c26c6acacfe8ee61bfd0a29846e5c5342ae | 7,842 | py | Python | Re-1-get-all-taxon-from-dwca-import-postgresql.py | moogoo78/portal20 | 085d598af0448ad34e22aa55981f7e82a042a893 | [
"MIT"
] | 7 | 2020-12-31T13:57:58.000Z | 2022-02-07T08:05:15.000Z | Re-1-get-all-taxon-from-dwca-import-postgresql.py | moogoo78/portal20 | 085d598af0448ad34e22aa55981f7e82a042a893 | [
"MIT"
] | 75 | 2020-03-16T07:18:28.000Z | 2022-03-31T09:55:15.000Z | Re-1-get-all-taxon-from-dwca-import-postgresql.py | moogoo78/portal20 | 085d598af0448ad34e22aa55981f7e82a042a893 | [
"MIT"
] | 9 | 2020-01-06T14:08:51.000Z | 2022-01-03T05:19:54.000Z | #!/usr/bin/env python
# coding: utf-8
# In[1]:
# via: https://github.com/tdwg/dwc/tree/master/dist
dwc_terms_str = 'type,modified,language,license,rightsHolder,accessRights,bibliographicCitation,references,institutionID,collectionID,datasetID,institutionCode,collectionCode,datasetName,ownerInstitutionCode,basisOfRecord,informationWithheld,dataGeneralizations,dynamicProperties,occurrenceID,catalogNumber,recordNumber,recordedBy,individualCount,organismQuantity,organismQuantityType,sex,lifeStage,reproductiveCondition,behavior,establishmentMeans,occurrenceStatus,preparations,disposition,associatedMedia,associatedReferences,associatedSequences,associatedTaxa,otherCatalogNumbers,occurrenceRemarks,organismID,organismName,organismScope,associatedOccurrences,associatedOrganisms,previousIdentifications,organismRemarks,materialSampleID,eventID,parentEventID,fieldNumber,eventDate,eventTime,startDayOfYear,endDayOfYear,year,month,day,verbatimEventDate,habitat,samplingProtocol,sampleSizeValue,sampleSizeUnit,samplingEffort,fieldNotes,eventRemarks,locationID,higherGeographyID,higherGeography,continent,waterBody,islandGroup,island,country,countryCode,stateProvince,county,municipality,locality,verbatimLocality,minimumElevationInMeters,maximumElevationInMeters,verbatimElevation,minimumDepthInMeters,maximumDepthInMeters,verbatimDepth,minimumDistanceAboveSurfaceInMeters,maximumDistanceAboveSurfaceInMeters,locationAccordingTo,locationRemarks,decimalLatitude,decimalLongitude,geodeticDatum,coordinateUncertaintyInMeters,coordinatePrecision,pointRadiusSpatialFit,verbatimCoordinates,verbatimLatitude,verbatimLongitude,verbatimCoordinateSystem,verbatimSRS,footprintWKT,footprintSRS,footprintSpatialFit,georeferencedBy,georeferencedDate,georeferenceProtocol,georeferenceSources,georeferenceVerificationStatus,georeferenceRemarks,geologicalContextID,earliestEonOrLowestEonothem,latestEonOrHighestEonothem,earliestEraOrLowestErathem,latestEraOrHighestErathem,earliestPeriodOrLowestSystem,latestPeriodOrHighestSystem,earliestEpochOrLowestSeries,latestEpochOrHighestSeries,earliestAgeOrLowestStage,latestAgeOrHighestStage,lowestBiostratigraphicZone,highestBiostratigraphicZone,lithostratigraphicTerms,group,formation,member,bed,identificationID,identificationQualifier,typeStatus,identifiedBy,dateIdentified,identificationReferences,identificationVerificationStatus,identificationRemarks,taxonID,scientificNameID,acceptedNameUsageID,parentNameUsageID,originalNameUsageID,nameAccordingToID,namePublishedInID,taxonConceptID,scientificName,acceptedNameUsage,parentNameUsage,originalNameUsage,nameAccordingTo,namePublishedIn,namePublishedInYear,higherClassification,kingdom,phylum,class,order,family,genus,subgenus,specificEpithet,infraspecificEpithet,taxonRank,verbatimTaxonRank,scientificNameAuthorship,vernacularName,nomenclaturalCode,taxonomicStatus,nomenclaturalStatus,taxonRemarks'
import os
import re
import pandas as pd
import numpy as np
from sqlalchemy import create_engine
from dwca.read import DwCAReader
# In[2]:
IPT_DWCA_PATH = 'ipt-dwca'
counter = 0
dwc_terms_list = dwc_terms_str.split(',')
# In[3]:
# change dwc-terms to lower and underline
def to_lower(name):
# https://stackoverflow.com/a/7322163/644070
s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name)
return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower()
# In[4]:
df_datasets = pd.read_csv('0-dataset-list_20200612-155723.csv')
# In[5]:
all_taxon = 0
core_append = []
for i in df_datasets.iterrows():
counter += 1
r = i[1]['name'].replace('http://ipt.taibif.tw/eml.do?r=', '')
fpath = os.path.join(IPT_DWCA_PATH, r) + '.zip'
num_err = 0
if os.path.exists(fpath):
with DwCAReader(fpath) as dwca:
#print (dwca.metadata)
print (counter, i[1]['title'], dwca.descriptor.core.type,len(dwca.rows))
if 'Taxon' in dwca.descriptor.core.type:
#print (type(dwca.rows), '||')
all_taxon += len(dwca.rows)
core_df = dwca.pd_read('taxon.txt', parse_dates=True)
#core_append.append(core_df)
if 'year' in core_df.columns.to_list():
idx = 0
for x in core_df.iterrows():
core_df.at[idx, 'q_year'] = x[1]['year']
if 'month' in core_df.columns.to_list():
core_df.at[idx, 'q_month'] = x[1]['month']
if 'day' in core_df.columns.to_list():
core_df.at[idx, 'q_day'] = x[1]['day']
idx += 1
#core_df['index'] = counter
df_all_taxon = pd.DataFrame(columns=list(core_df.columns))
core_append.append(core_df)
res_f = pd.concat(core_append, ignore_index=True, sort=False)
df_all_taxon = pd.concat([df_all_taxon, res_f],sort=False,ignore_index=True) ##Get the occurrence ID and other infor.
#core_df.rename(columns=column_name_map)
#core_df.to_sql('data_occurrence', engine, index_label='id', if_exists='append')
#print (core_df)
else:
extensions = dwca.descriptor.extensions_type
if 'http://rs.tdwg.org/dwc/terms/Taxon' in extensions:
ext_df = dwca.pd_read('taxon.txt')
ext_df['dataset_name'] = dataset_name
#ext_df['index'] = counter
#edf.columns = [column_name_map[x] for x in edf.columns]
## add event column if Event!
''''if 'Event' in dwca.descriptor.core.type:
event_df = dwca.pd_read('event.txt')
has_event_date = False
if 'eventDate' in event_df.columns.to_list():
event_df = dwca.pd_read('event.txt', parse_dates=['eventDate'])
has_event_date = True
idx = 0
for o in ext_df.iterrows():
event_id = o[1]['eventID']
e = event_df.loc[event_df['eventID']==event_id]
for t in event_df.columns.to_list():
if not e.empty:
s = e.iloc[0][t]
if has_event_date and t == 'eventDate':
s = s.strftime('%Y-%m-%d')
#print (s, type(s))
try:
ext_df.at[idx, t] = s
except:
num_err += 1
#print (type(s), s)
idx += 1'''
all_taxon += len(ext_df)
#print (edf.columns)
df_all_taxon = pd.concat([df_all_taxon, ext_df],sort=False,ignore_index=True)
#ext_df.rename(columns=column_name_map)
#ext_df.to_sql('data_occurrence', engine, index_label='id', if_exists='append')
# In[6]:
df_all_taxon
# In[7]:
from sqlalchemy import create_engine
engine = create_engine('postgresql://postgres:jonghoonharuma@localhost:5432/test')
# In[8]:
df_all_taxon.to_sql('taxon_20200618', engine)
# In[9]:
df_all_taxon.to_csv('df_all_taxon.csv',encoding="utf_8_sig")
#display(df_all_occur)
#print (df_all_occur.columns)
df_all_taxon = df_all_taxon.rename(columns=column_name_map)
#print (df_all_occur.columns)
# In[ ]:
| 49.0125 | 2,777 | 0.647539 | 792 | 7,842 | 6.237374 | 0.417929 | 0.018219 | 0.022267 | 0.015182 | 0.148785 | 0.088866 | 0.056275 | 0.046154 | 0.034818 | 0.034818 | 0 | 0.012768 | 0.250956 | 7,842 | 159 | 2,778 | 49.320755 | 0.828226 | 0.107753 | 0 | 0.037736 | 0 | 0.018868 | 0.544527 | 0.501408 | 0 | 0 | 0 | 0 | 0 | 1 | 0.018868 | false | 0 | 0.132075 | 0 | 0.169811 | 0.037736 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
f5f9e41c2e24a2b602d8cf15fb72b59d530e988a | 1,608 | py | Python | operatingSystemFunctions/audioNotifiers.py | nav9/iRest | 12e6fdaeb0fa9d253c056fd2de057dd9d1aa8121 | [
"MIT"
] | null | null | null | operatingSystemFunctions/audioNotifiers.py | nav9/iRest | 12e6fdaeb0fa9d253c056fd2de057dd9d1aa8121 | [
"MIT"
] | null | null | null | operatingSystemFunctions/audioNotifiers.py | nav9/iRest | 12e6fdaeb0fa9d253c056fd2de057dd9d1aa8121 | [
"MIT"
] | null | null | null | import logging
import subprocess
from abc import ABC, abstractmethod
class AudioNotifier(ABC):#Abstract parent class
#Note: Abstract methods have to be implemented by child classes because they would be invoked by other classes
@abstractmethod
def __init__(self):
#self.id = "someUniqueNotifierName" #has to be implemented in the child class
pass
@abstractmethod
def notifyUserToTakeRest(self):
""" Plays an audio notification to remind the user to take rest. Function does not return anything """
pass
# @abstractmethod
# def notifyUserThatRestPeriodIsOver(self):
# """ Plays an audio notification to inform the user that the resting period completed. Function does not return anything """
# pass
#TODO: Check if the OS has Speed Say installed
#Note: This is an Ubuntu-specific notifier. Notifications could also be programmed as a simple bell sound etc.
class SpeedSayAudioNotifier_Linux(AudioNotifier):
def __init__(self):
self.id = "Speed Say Notifier"
self.speechProgram = "spd-say"
self.waitUntilFullTextRead = "--wait"
self.speechRateArg = "-r"
self.speechRate = "-10" #TODO: should this be part of the config file?
self.fullCommand = [self.speechProgram, self.waitUntilFullTextRead, self.speechRateArg, self.speechRate]
self.takeRestMessage = "Take rest now"
def notifyUserToTakeRest(self):
speechCommand = self.fullCommand[:] #shallow copy by value
speechCommand.append(self.takeRestMessage)
subprocess.run(speechCommand) | 43.459459 | 133 | 0.710199 | 186 | 1,608 | 6.091398 | 0.532258 | 0.045013 | 0.026478 | 0.026478 | 0.141218 | 0.111209 | 0 | 0 | 0 | 0 | 0 | 0.001591 | 0.218284 | 1,608 | 37 | 134 | 43.459459 | 0.899761 | 0.445274 | 0 | 0.347826 | 0 | 0 | 0.056 | 0 | 0 | 0 | 0 | 0.027027 | 0 | 1 | 0.173913 | false | 0.086957 | 0.130435 | 0 | 0.391304 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
eb10f5ff1d134f02f3707995bf811c066d5e4b49 | 1,308 | py | Python | API/capture/Auto_image_detector.py | a710128/Lesson9 | 0f48651aff2cb12f97d92fb27d722d1680026ac1 | [
"MIT"
] | 1 | 2017-10-11T08:47:05.000Z | 2017-10-11T08:47:05.000Z | API/capture/Auto_image_detector.py | a710128/Lesson9 | 0f48651aff2cb12f97d92fb27d722d1680026ac1 | [
"MIT"
] | null | null | null | API/capture/Auto_image_detector.py | a710128/Lesson9 | 0f48651aff2cb12f97d92fb27d722d1680026ac1 | [
"MIT"
] | 1 | 2021-07-07T11:44:55.000Z | 2021-07-07T11:44:55.000Z | #encoding=utf-8
import os.path as _Os_path
from .model import get_model
from .model import characters
from .model import width
from .model import height
from .model import n_len
from keras.models import *
from keras.layers import *
from keras import backend as K
import cv2
import numpy as np
import tensorflow as tf
model_path = _Os_path.join(_Os_path.sep.join(__file__.split(_Os_path.sep)[:-1]), 'model.predict_new.h5')
predict_model = load_model(model_path)
def Detector_single_image(image , model_dir = 'model.predict_new.h5'):
img = cv2.resize(image, (width, height))
X_test = np.zeros((1, width, height, 3), dtype=np.int16)
X_test[0]=img.transpose(1,0,2)
y_pred = predict_model.predict(X_test)
y_pred = y_pred[:,2:,:]
text_list = K.get_value(K.ctc_decode(y_pred, input_length=np.ones(y_pred.shape[0])*y_pred.shape[1], )[0][0])[:, :n_len]
out = ''.join([characters[x] for x in text_list[0]])
return out
'''
example1
Detector_single_image('/home/liujiashuo/Desktop/img/2BFT.jpg')
Detector_single_image('/home/liujiashuo/Desktop/img/2B3KV.jpg')
Detector_single_image('/home/liujiashuo/Desktop/img/2B4F.jpg')
Detector_single_image(cv2.imread('./TEST/YWP9H.jpg', cv2.IMREAD_ANYCOLOR))
example2
Detector_multi_images('/home/liujiashuo/Desktop/TEST' , 16)
'''
| 22.551724 | 120 | 0.738532 | 214 | 1,308 | 4.280374 | 0.373832 | 0.032751 | 0.081878 | 0.075328 | 0.14738 | 0.14738 | 0.14738 | 0.100437 | 0 | 0 | 0 | 0.027802 | 0.120031 | 1,308 | 57 | 121 | 22.947368 | 0.768028 | 0.010703 | 0 | 0 | 0 | 0 | 0.042918 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.043478 | false | 0 | 0.521739 | 0 | 0.608696 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
eb26b0abc20cb065d5e865e9da337c66fc17b493 | 4,157 | py | Python | demo/models.py | joshuahaertel/index-royale | a088f48db231ab05316c5fe3648b079a26a1b658 | [
"MIT"
] | null | null | null | demo/models.py | joshuahaertel/index-royale | a088f48db231ab05316c5fe3648b079a26a1b658 | [
"MIT"
] | 6 | 2021-03-19T01:59:19.000Z | 2021-09-22T18:53:35.000Z | demo/models.py | joshuahaertel/index-royale | a088f48db231ab05316c5fe3648b079a26a1b658 | [
"MIT"
] | null | null | null | from typing import List
from uuid import uuid4
from django.db import models
from django.db.models import Sum, Avg, Count
from django.utils.functional import cached_property
class Demo(models.Model):
id = models.UUIDField(primary_key=True, default=uuid4)
state = models.CharField(max_length=7, default='wait', choices=(
('wait', 'Wait'),
('race', 'Race'),
('over', 'Over'),
))
current_batch_index = models.PositiveSmallIntegerField(default=0)
current_entry_index = models.PositiveSmallIntegerField(default=0)
current_field_index = models.PositiveSmallIntegerField(default=0)
def __init__(self, *args, batches=None, **kwargs):
super().__init__(*args, **kwargs)
self.batches: List[Batch] = batches or [DEFAULT_BATCH]
@property
def current_images(self):
return self.current_batch.images
@property
def current_batch(self):
return self.batches[self.current_batch_index]
@property
def max_batch_index(self):
return len(self.batches) - 1
@property
def current_batch_max_entry_index(self):
return len(self.current_batch.entries) - 1
@property
def current_entry_max_field_index(self):
return len(self.current_entry.fields) - 1
@property
def current_label(self):
entry = self.current_entry
return entry.fields[self.current_field_index].label
@property
def current_entry(self):
return self.current_batch.entries[self.current_entry_index]
@cached_property
def teams_in_winning_order(self):
return self.team_set.annotate(
average_points=Avg('player__points'),
total_players=Count('player'),
).order_by('-average_points')
@cached_property
def teamless_players(self):
return self.player_set.filter(team=None)
@property
def teamless_players_average_points(self):
if not self.teamless_players:
return 0.0
points = sum(player.points for player in self.teamless_players)
return points/len(self.teamless_players)
@property
def can_wait(self):
return self.state != 'wait'
@property
def can_race(self):
return self.state == 'wait'
@property
def can_finish(self):
return self.state == 'wait'
class Batch:
def __init__(self, entries=None, images=None, name=''):
self.entries: List[Entry] = entries or []
self.images: List[str] = images or []
self.name: str = name
class Entry:
def __init__(self, fields=None):
self.fields: List[Field] = fields or []
class Field:
def __init__(self, label, value=None):
self.label: str = label
self.value: str = value
DEFAULT_BATCH = Batch(
entries=[Entry(
fields=[
Field('Name', 'josh'),
Field('Day', '7'),
]
)],
images=[
'demo/test-1.png',
'demo/test-2.png',
],
name='Example',
)
class Team(models.Model):
id = models.UUIDField(primary_key=True, default=uuid4)
demo = models.ForeignKey(Demo, models.CASCADE)
name = models.CharField(max_length=63)
@property
def points(self):
return self.player_set.aggregate(Sum('points'))['points__sum']
@cached_property
def players_in_best_order(self):
return self.player_set.all().order_by('-points')
class BasePlayer(models.Model):
points = models.SmallIntegerField(default=0)
team = models.ForeignKey(Team, models.SET_NULL, null=True, blank=True)
name = models.CharField(max_length=63)
skill_level = models.CharField(default='beg', max_length=3, choices=(
('beg', 'Beginner'),
('int', 'Intermediate'),
('adv', 'Advanced'),
))
class Meta:
abstract = True
class Player(BasePlayer, models.Model):
id = models.UUIDField(primary_key=True, default=uuid4)
demo = models.ForeignKey(Demo, models.CASCADE)
class Admin(models.Model):
id = models.UUIDField(primary_key=True, default=uuid4)
demo = models.OneToOneField(Demo, models.CASCADE)
class PlayingAdmin(Admin, BasePlayer):
pass
| 26.477707 | 74 | 0.656002 | 505 | 4,157 | 5.209901 | 0.219802 | 0.062714 | 0.053212 | 0.028886 | 0.305587 | 0.22577 | 0.142151 | 0.142151 | 0.114025 | 0.114025 | 0 | 0.007147 | 0.225884 | 4,157 | 156 | 75 | 26.647436 | 0.810441 | 0 | 0 | 0.228814 | 0 | 0 | 0.045225 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.161017 | false | 0.008475 | 0.042373 | 0.110169 | 0.559322 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 2 |
eb2db66177bc92e9b572649433aade69a39043ee | 997 | py | Python | src/moveRow.py | Cryolupus/AutoElectroChemCtrlBaker | bd10b3de4667523db4897c0286e100da1b428a78 | [
"MIT"
] | null | null | null | src/moveRow.py | Cryolupus/AutoElectroChemCtrlBaker | bd10b3de4667523db4897c0286e100da1b428a78 | [
"MIT"
] | null | null | null | src/moveRow.py | Cryolupus/AutoElectroChemCtrlBaker | bd10b3de4667523db4897c0286e100da1b428a78 | [
"MIT"
] | null | null | null | def moveRow(horizontaldist,horizontalDir,speed, device):
from src.moveDist import movedist
# -------------------------------------------------------------------------
# TODO: Move up
# -------------------------------------------------------------------------
movedist(distance=10, direction=1,speed=speed,device=device) #move up off of the plate
# -------------------------------------------------------------------------
# TODO: Move to next node in the row, make sure horizontalDirection is compatiable with -1 or 1
# -------------------------------------------------------------------------
trueHorzDir = horizontalDir #convert -1 or 1 to direction
movedist(distance=horizontaldist, direction=trueHorzDir,speed=speed,device=device)
# -------------------------------------------------------------------------
# TODO: Move down
# -------------------------------------------------------------------------
from src.moveSense import movesense
movesense()
return;
| 38.346154 | 95 | 0.407222 | 73 | 997 | 5.561644 | 0.520548 | 0.081281 | 0.078818 | 0.108374 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.007856 | 0.106319 | 997 | 25 | 96 | 39.88 | 0.447811 | 0.620863 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.04 | 0 | 1 | 0.125 | false | 0 | 0.25 | 0 | 0.375 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
eb3a664b99fa8499215c8bfccad6e002c0d9fa47 | 679 | py | Python | day4/Python_Dungeon_game_MiniProject.py | dikshaa1702/ml | c35f279b8fa7544517ca713c2c1e55f08270d4c3 | [
"Apache-2.0"
] | 1 | 2019-06-13T13:52:09.000Z | 2019-06-13T13:52:09.000Z | day4/Python_Dungeon_game_MiniProject.py | dikshaa1702/ml | c35f279b8fa7544517ca713c2c1e55f08270d4c3 | [
"Apache-2.0"
] | null | null | null | day4/Python_Dungeon_game_MiniProject.py | dikshaa1702/ml | c35f279b8fa7544517ca713c2c1e55f08270d4c3 | [
"Apache-2.0"
] | null | null | null | # Dungeon Game
"""
Challenge 1
It would be a 2 dimensional maze game
We would put the player in a random room in the grid
We would also put a monster in a random room in the grid
We would out a door in a random room in the grid
The player would then move around the grid to find the door
Don’t let he player go out of the edges of the grid
If they hit the monster room they are eaten by the monster
or if they reach the gate they win
Grid of Room = Collection of Coordinates
Player is a tuple, it contains two values
"""
"""
Challenge 2
Welcome message is getting printed every-time
Can we display the grid for the visual
""" | 28.291667 | 63 | 0.706922 | 125 | 679 | 3.84 | 0.496 | 0.0875 | 0.05625 | 0.08125 | 0.166667 | 0.166667 | 0.166667 | 0.120833 | 0.120833 | 0 | 0 | 0.006036 | 0.268041 | 679 | 24 | 64 | 28.291667 | 0.959759 | 0.821797 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
eb3b9d3ded3e1b2741b6dc2e4ef7c64b6c412306 | 616 | py | Python | test/priors/test_utils.py | bdecost/gpytorch | a5f1ad3e47daf3f8db04b605fb13ff3f9f871e3a | [
"MIT"
] | null | null | null | test/priors/test_utils.py | bdecost/gpytorch | a5f1ad3e47daf3f8db04b605fb13ff3f9f871e3a | [
"MIT"
] | null | null | null | test/priors/test_utils.py | bdecost/gpytorch | a5f1ad3e47daf3f8db04b605fb13ff3f9f871e3a | [
"MIT"
] | 1 | 2018-11-15T10:03:40.000Z | 2018-11-15T10:03:40.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
from gpytorch.priors._compatibility import _bounds_to_prior
from gpytorch.priors import GammaPrior, SmoothedBoxPrior
class TestPriorUtils(unittest.TestCase):
def test_bounds_to_prior(self):
prior = GammaPrior(1, 1)
self.assertEqual(prior, _bounds_to_prior(prior=prior, bounds=None))
self.assertIsInstance(_bounds_to_prior(prior=None, bounds=(-10, 10)), SmoothedBoxPrior)
if __name__ == "__main__":
unittest.main()
| 30.8 | 95 | 0.790584 | 75 | 616 | 5.96 | 0.426667 | 0.089485 | 0.143177 | 0.080537 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.011278 | 0.136364 | 616 | 19 | 96 | 32.421053 | 0.828947 | 0 | 0 | 0 | 0 | 0 | 0.012987 | 0 | 0 | 0 | 0 | 0 | 0.142857 | 1 | 0.071429 | false | 0 | 0.5 | 0 | 0.642857 | 0.071429 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
de170262d796f529f9e26cc3d58f382f6e921e9d | 1,044 | py | Python | ssupervisor/lib/parser.py | Infinium8/Supervisor | 95f3f1be31cb4e9acb51642b96285119cf2eb80f | [
"MIT"
] | null | null | null | ssupervisor/lib/parser.py | Infinium8/Supervisor | 95f3f1be31cb4e9acb51642b96285119cf2eb80f | [
"MIT"
] | null | null | null | ssupervisor/lib/parser.py | Infinium8/Supervisor | 95f3f1be31cb4e9acb51642b96285119cf2eb80f | [
"MIT"
] | null | null | null | '''
Handles parsing of the .supervisorconf file.
'''
import os
class InvalidEventValue(Exception):
pass
class InvalidPathValue(Exception):
pass
class Parser:
def __init__(self):
self.config = None
def _verify_event(self, event):
# Make sure the event values are valid
events = ['any', 'created', 'modified', 'deleted', 'moved']
if event not in events:
raise InvalidEventValue(f'\n\nYou cannot use "{event}" as an event value.\n\nThe available options are: {events}\n')
def _verify_path(self, path):
# Make sure the requested path exists
if not os.path.exists(path):
raise InvalidPathValue(f'The path, "{path}" does not exist.')
def _verify_values(self, lines):
# Handles running error-checking parse
# functions on different parts of a config
# line.
for line in lines:
self._verify_event(line[0])
self._verify_path(line[1])
def parse(self, config):
# @returns like: [['any', '/path/', 'command']]
lines = [line.split(":::") for line in config]
self._verify_values(lines)
return lines | 24.857143 | 119 | 0.697318 | 146 | 1,044 | 4.876712 | 0.486301 | 0.037921 | 0.050562 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.002318 | 0.173372 | 1,044 | 42 | 120 | 24.857143 | 0.822711 | 0.237548 | 0 | 0.086957 | 0 | 0.043478 | 0.197704 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.217391 | false | 0.086957 | 0.043478 | 0 | 0.434783 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
de1b6b4d0048abd29853af3cbbd923b51ed9a8da | 519 | py | Python | snow/resource/fields/boolean.py | sulbig/snow | 2f838a0bdf9b626cec5119c03b743abe812db311 | [
"MIT"
] | null | null | null | snow/resource/fields/boolean.py | sulbig/snow | 2f838a0bdf9b626cec5119c03b743abe812db311 | [
"MIT"
] | null | null | null | snow/resource/fields/boolean.py | sulbig/snow | 2f838a0bdf9b626cec5119c03b743abe812db311 | [
"MIT"
] | null | null | null | from .base import BaseField
from ..query import BooleanOperator
class Boolean(BaseField):
def is_true(self):
"""
Example: active.is_true()
All records in which the Active field is True.
"""
return self._condition(BooleanOperator.EQUALS, "true")
def is_falsy(self):
"""
Example: active.is_falsy()
All records in which the Active field is False, empty, or NULL.
"""
return self._condition(BooleanOperator.NOT_EQUALS, "true")
| 21.625 | 71 | 0.624277 | 61 | 519 | 5.196721 | 0.47541 | 0.056782 | 0.107256 | 0.119874 | 0.208202 | 0.208202 | 0.208202 | 0.208202 | 0 | 0 | 0 | 0 | 0.279383 | 519 | 23 | 72 | 22.565217 | 0.847594 | 0.317919 | 0 | 0 | 0 | 0 | 0.027491 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.285714 | false | 0 | 0.285714 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
de27d0246d9470cc21c92aa643caf5e85733dcb2 | 199 | py | Python | utils.py | salihtuc/storage-library-api | f289ca89ce6fd55e26f24adf2886d821a065b2bc | [
"MIT"
] | null | null | null | utils.py | salihtuc/storage-library-api | f289ca89ce6fd55e26f24adf2886d821a065b2bc | [
"MIT"
] | null | null | null | utils.py | salihtuc/storage-library-api | f289ca89ce6fd55e26f24adf2886d821a065b2bc | [
"MIT"
] | null | null | null | import os
def check_and_fix_directory(dir_name):
"""This function is using for creating given directpry, if it is not exists."""
if not os.path.exists(dir_name):
os.mkdir(dir_name)
| 24.875 | 83 | 0.708543 | 33 | 199 | 4.090909 | 0.69697 | 0.155556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.19598 | 199 | 7 | 84 | 28.428571 | 0.84375 | 0.366834 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
de31b586f91602f36340afc9a3c9d4b3cc28cef2 | 730 | py | Python | oops_fhir/r4/value_set/data_element_sdcobject_class.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/data_element_sdcobject_class.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | oops_fhir/r4/value_set/data_element_sdcobject_class.py | Mikuana/oops_fhir | 77963315d123756b7d21ae881f433778096a1d25 | [
"MIT"
] | null | null | null | from pathlib import Path
from fhir.resources.valueset import ValueSet as _ValueSet
from oops_fhir.utils import ValueSet
from oops_fhir.r4.code_system.snomed_ct import SNOMEDCT
__all__ = ["DataElementSDCObjectClass"]
_resource = _ValueSet.parse_file(Path(__file__).with_suffix(".json"))
class DataElementSDCObjectClass(SNOMEDCT):
"""
DataElement SDC Object Class
The allowed codes for identifying the ISO 11179 ObjectClass Property for
a particular data element if intended for registration/use within the
U.S. Structured Data Capture (SDC) project.
Status: draft - Version: 4.0.1
http://hl7.org/fhir/ValueSet/dataelement-sdcobjectclassproperty
"""
class Meta:
resource = _resource
| 23.548387 | 76 | 0.764384 | 92 | 730 | 5.869565 | 0.673913 | 0.051852 | 0.059259 | 0.074074 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.016367 | 0.163014 | 730 | 30 | 77 | 24.333333 | 0.86743 | 0.445205 | 0 | 0 | 0 | 0 | 0.077121 | 0.064267 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.444444 | 0 | 0.666667 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
de410c2501327b5fcaa147c4bd8f5071dced9a26 | 10,193 | py | Python | scripts/strelka-2.9.2.centos6_x86_64/lib/python/makeRunScript.py | dongxuemin666/RNA-combine | 13e178aae585e16a9a8eda8151d0f34316de0475 | [
"Apache-2.0"
] | 7 | 2021-09-03T09:11:00.000Z | 2022-02-14T15:02:12.000Z | scripts/strelka-2.9.2.centos6_x86_64/lib/python/makeRunScript.py | dongxuemin666/RNA-combine | 13e178aae585e16a9a8eda8151d0f34316de0475 | [
"Apache-2.0"
] | null | null | null | scripts/strelka-2.9.2.centos6_x86_64/lib/python/makeRunScript.py | dongxuemin666/RNA-combine | 13e178aae585e16a9a8eda8151d0f34316de0475 | [
"Apache-2.0"
] | 2 | 2022-01-10T13:07:29.000Z | 2022-01-11T22:14:11.000Z | #
# Strelka - Small Variant Caller
# Copyright (c) 2009-2018 Illumina, Inc.
#
# 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, either version 3 of the License, or
# at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#
"""
This provides a function to auto-generate a workflow run script.
"""
import os, sys
from configureUtil import pickleConfigSections
def makeRunScript(scriptFile, workflowModulePath, workflowClassName, primaryConfigSection, configSections, pythonBin=None) :
"""
This function generates the python workflow runscript
The auto-generated python script presents the user with options to
run and/or continue their workflow, and reads all workflow
configuration info from an ini file.
scriptFile -- file name of the runscript to create
workflowModulePath -- the python module containing the workflow class
workflowClassName -- the workflow class name
primaryConfigSection -- the section used to create the primary workflow parameter object
configSections -- a hash or hashes representing all configuration info
@param pythonBin: optionally specify a custom python interpreter for the script she-bang
"""
assert os.path.isdir(os.path.dirname(scriptFile))
assert os.path.isfile(workflowModulePath)
workflowModulePath=os.path.abspath(workflowModulePath)
workflowModuleDir=os.path.dirname(workflowModulePath)
workflowModuleName=os.path.basename(workflowModulePath)
pyExt=".py"
if workflowModuleName.endswith(pyExt) :
workflowModuleName=workflowModuleName[:-len(pyExt)]
# dump inisections to a file
pickleConfigFile=scriptFile+".config.pickle"
pickleConfigSections(pickleConfigFile,configSections)
sfp=open(scriptFile,"w")
if pythonBin is None :
pythonBin="/usr/bin/env python2"
sfp.write(runScript1 % (pythonBin, " ".join(sys.argv),workflowModuleDir,workflowModuleName,workflowClassName))
sfp.write('\n')
sfp.write(runScript2)
sfp.write('\n')
sfp.write(runScript3)
sfp.write('\n')
sfp.write('main(r"%s","%s",%s)\n' % (pickleConfigFile, primaryConfigSection, workflowClassName))
sfp.write('\n')
sfp.close()
os.chmod(scriptFile,0755)
runScript1="""#!%s
# Workflow run script auto-generated by command: '%s'
#
import os, sys
if sys.version_info >= (3,0):
import platform
raise Exception("Strelka does not currently support python3 (version %%s detected)" %% (platform.python_version()))
if sys.version_info < (2,6):
import platform
raise Exception("Strelka requires python2 version 2.6+ (version %%s detected)" %% (platform.python_version()))
scriptDir=os.path.abspath(os.path.dirname(__file__))
sys.path.append(r'%s')
from %s import %s
"""
runScript2="""
def get_run_options(workflowClassName) :
from optparse import OptionGroup, SUPPRESS_HELP
from configBuildTimeInfo import workflowVersion
from configureUtil import EpilogOptionParser
from estimateHardware import EstException, getNodeHyperthreadCoreCount, getNodeMemMb
sgeDefaultCores=workflowClassName.runModeDefaultCores('sge')
epilog=\"\"\"Note this script can be re-run to continue the workflow run in case of interruption.
Also note that dryRun option has limited utility when task definition depends on upstream task
results -- in this case the dry run will not cover the full 'live' run task set.\"\"\"
parser = EpilogOptionParser(description="Version: %s" % (workflowVersion), epilog=epilog, version=workflowVersion)
parser.add_option("-m", "--mode", type="string",dest="mode",
help="select run mode (local|sge)")
parser.add_option("-q", "--queue", type="string",dest="queue",
help="specify scheduler queue name")
parser.add_option("-j", "--jobs", type="string",dest="jobs",
help="number of jobs, must be an integer or 'unlimited' (default: Estimate total cores on this node for local mode, %s for sge mode)" % (sgeDefaultCores))
parser.add_option("-g","--memGb", type="string",dest="memGb",
help="gigabytes of memory available to run workflow -- only meaningful in local mode, must be an integer (default: Estimate the total memory for this node for local mode, 'unlimited' for sge mode)")
parser.add_option("-d","--dryRun", dest="isDryRun",action="store_true",default=False,
help="dryRun workflow code without actually running command-tasks")
parser.add_option("--quiet", dest="isQuiet",action="store_true",default=False,
help="Don't write any log output to stderr (but still write to workspace/pyflow.data/logs/pyflow_log.txt)")
def isLocalSmtp() :
import smtplib
try :
smtplib.SMTP('localhost')
except :
return False
return True
isEmail = isLocalSmtp()
emailHelp = SUPPRESS_HELP
if isEmail :
emailHelp="send email notification of job completion status to this address (may be provided multiple times for more than one email address)"
parser.add_option("-e","--mailTo", type="string",dest="mailTo",action="append",help=emailHelp)
debug_group = OptionGroup(parser,"development debug options")
debug_group.add_option("--rescore", dest="isRescore",action="store_true",default=False,
help="Reset task list to re-run hypothesis generation and scoring without resetting graph generation.")
parser.add_option_group(debug_group)
ext_group = OptionGroup(parser,"extended portability options (should not be needed by most users)")
ext_group.add_option("--maxTaskRuntime", type="string", metavar="hh:mm:ss",
help="Specify scheduler max runtime per task, argument is provided to the 'h_rt' resource limit if using SGE (no default)")
parser.add_option_group(ext_group)
(options,args) = parser.parse_args()
if not isEmail : options.mailTo = None
if len(args) :
parser.print_help()
sys.exit(2)
if options.mode is None :
parser.print_help()
sys.exit(2)
elif options.mode not in ["local","sge"] :
parser.error("Invalid mode. Available modes are: local, sge")
if options.jobs is None :
if options.mode == "sge" :
options.jobs = sgeDefaultCores
else :
try :
options.jobs = getNodeHyperthreadCoreCount()
except EstException:
parser.error("Failed to estimate cores on this node. Please provide job count argument (-j).")
if options.jobs != "unlimited" :
options.jobs=int(options.jobs)
if options.jobs <= 0 :
parser.error("Jobs must be 'unlimited' or an integer greater than 1")
# note that the user sees gigs, but we set megs
if options.memGb is None :
if options.mode == "sge" :
options.memMb = "unlimited"
else :
try :
options.memMb = getNodeMemMb()
except EstException:
parser.error("Failed to estimate available memory on this node. Please provide available gigabyte argument (-g).")
elif options.memGb != "unlimited" :
options.memGb=int(options.memGb)
if options.memGb <= 0 :
parser.error("memGb must be 'unlimited' or an integer greater than 1")
options.memMb = 1024*options.memGb
else :
options.memMb = options.memGb
options.schedulerArgList=[]
if options.queue is not None :
options.schedulerArgList.extend(["-q",options.queue])
if options.maxTaskRuntime is not None :
options.schedulerArgList.extend(["-l","h_rt="+options.maxTaskRuntime])
options.resetTasks=[]
if options.isRescore :
options.resetTasks.append("makeHyGenDir")
return options
"""
runScript3="""
def main(pickleConfigFile, primaryConfigSection, workflowClassName) :
from configureUtil import getConfigWithPrimaryOptions
runOptions=get_run_options(workflowClassName)
flowOptions,configSections=getConfigWithPrimaryOptions(pickleConfigFile,primaryConfigSection)
# new logs and marker files to assist automated workflow monitoring:
warningpath=os.path.join(flowOptions.runDir,"workflow.warning.log.txt")
errorpath=os.path.join(flowOptions.runDir,"workflow.error.log.txt")
exitpath=os.path.join(flowOptions.runDir,"workflow.exitcode.txt")
# the exit path should only exist once the workflow completes:
if os.path.exists(exitpath) :
if not os.path.isfile(exitpath) :
raise Exception("Unexpected filesystem item: '%s'" % (exitpath))
os.unlink(exitpath)
wflow = workflowClassName(flowOptions)
retval=1
try:
retval=wflow.run(mode=runOptions.mode,
nCores=runOptions.jobs,
memMb=runOptions.memMb,
dataDirRoot=flowOptions.workDir,
mailTo=runOptions.mailTo,
isContinue="Auto",
isForceContinue=True,
isDryRun=runOptions.isDryRun,
isQuiet=runOptions.isQuiet,
schedulerArgList=runOptions.schedulerArgList,
resetTasks=runOptions.resetTasks,
successMsg=wflow.getSuccessMessage(),
retryWindow=0,
retryMode='all',
warningLogFile=warningpath,
errorLogFile=errorpath)
finally:
exitfp=open(exitpath,"w")
exitfp.write("%i\\n" % (retval))
exitfp.close()
sys.exit(retval)
"""
| 38.756654 | 216 | 0.673305 | 1,183 | 10,193 | 5.76585 | 0.340659 | 0.011435 | 0.019792 | 0.007037 | 0.139716 | 0.098812 | 0.03284 | 0.011142 | 0.011142 | 0 | 0 | 0.005081 | 0.227705 | 10,193 | 262 | 217 | 38.90458 | 0.861408 | 0.069165 | 0 | 0.152941 | 0 | 0.058824 | 0.860177 | 0.274021 | 0 | 0 | 0 | 0 | 0.011765 | 0 | null | null | 0 | 0.070588 | null | null | 0.011765 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
de51495d8b53ce251757d17669de5f7ace51d6f6 | 1,235 | py | Python | requirement/models.py | 810Teams/requirement-classification | 39a6db09446275b030a14fed3367b8e7cccbe5fc | [
"MIT"
] | null | null | null | requirement/models.py | 810Teams/requirement-classification | 39a6db09446275b030a14fed3367b8e7cccbe5fc | [
"MIT"
] | 1 | 2019-11-28T07:51:52.000Z | 2019-11-28T07:51:52.000Z | requirement/models.py | 810Teams/requirement-classification | 39a6db09446275b030a14fed3367b8e7cccbe5fc | [
"MIT"
] | 1 | 2020-02-20T15:36:09.000Z | 2020-02-20T15:36:09.000Z | from django.db import models
from pythainlp.corpus.common import thai_words
from pythainlp.tag import pos_tag
from pythainlp import Tokenizer
THAI_WORDS = set(thai_words())
for i in open('requirement/data/custom_tokenizer.txt', encoding="utf-8"):
THAI_WORDS.add(i.replace('\n', '').strip())
TOKENIZER = Tokenizer(THAI_WORDS)
class AnalyzedRequirement(models.Model):
PRIORITY_CHOICES = (
(0, 'low'),
(1, 'medium'),
(2, 'high'),
)
IS_FUNCTIONAL_CHOICES = (
(False, 'non-functional'),
(True, 'functional'),
)
text = models.TextField(null=False, blank=False)
priority = models.IntegerField(choices=PRIORITY_CHOICES, null=True, blank=True)
is_functional = models.BooleanField(choices=IS_FUNCTIONAL_CHOICES, null=True, blank=True)
def __str__(self):
return '{} ({} | {})'.format(self.text, self.priority, self.is_functional)
def get_words(self):
return TOKENIZER.word_tokenize(self.text)
def get_pos_tag(self):
return pos_tag(self.get_words())
def get_pos_tag_refined(self, remove_list=('NCMN', 'RPRE', 'VACT', 'VATT', 'VSTA')):
return [i for i in self.get_pos_tag() if i[1] not in remove_list and i[0] != ' ']
| 30.875 | 93 | 0.668016 | 164 | 1,235 | 4.835366 | 0.426829 | 0.056747 | 0.034048 | 0.050441 | 0.06053 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005988 | 0.188664 | 1,235 | 39 | 94 | 31.666667 | 0.785429 | 0 | 0 | 0 | 0 | 0 | 0.092308 | 0.02996 | 0 | 0 | 0 | 0 | 0 | 1 | 0.137931 | false | 0 | 0.137931 | 0.137931 | 0.62069 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 2 |
de8a9c87607774e609cfe06054d4a8f2ea925b1a | 5,527 | py | Python | test_ensemble.py | Sette/CoNAS | 19b061fb7177fb2d2b0eca94f16e8d4b57178859 | [
"Apache-2.0"
] | null | null | null | test_ensemble.py | Sette/CoNAS | 19b061fb7177fb2d2b0eca94f16e8d4b57178859 | [
"Apache-2.0"
] | null | null | null | test_ensemble.py | Sette/CoNAS | 19b061fb7177fb2d2b0eca94f16e8d4b57178859 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""test_ensemble.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1Y0wUtSeRwwUQm2tJneNIcHT_C_cxRJiY
"""
path_logits_darts = "cnn/"
path_logits1 = "cnn_space1/"
path_logits2 = "cnn_space2/"
path_logits3 = "cnn_space3"
import pickle
import os
import sys
import glob
import json
import numpy as np
import torch
import utils
import logging
import argparse
import pickle
import time
import torch.nn as nn
import torch.utils
import torchvision.datasets as dset
import torch.backends.cudnn as cudnn
from torch.autograd import Variable
import torchvision
import torchvision.transforms as transforms
save = path_logits+'/test-{}-{}'.format("ENS", time.strftime("%Y%m%d-%H%M%S"))
utils.create_exp_dir(save, scripts_to_save=glob.glob('*.py'))
log_format = '%(asctime)s %(message)s'
logging.basicConfig(stream=sys.stdout, level=logging.INFO,
format=log_format, datefmt='%m/%d %I:%M:%S %p')
fh = logging.FileHandler(os.path.join(save, 'log.txt'))
fh.setFormatter(logging.Formatter(log_format))
logging.getLogger().addHandler(fh)
class Cutout(object):
def __init__(self, length):
self.length = length
def __call__(self, img):
h, w = img.size(1), img.size(2)
mask = np.ones((h, w), np.float32)
y = np.random.randint(h)
x = np.random.randint(w)
y1 = np.clip(y - self.length // 2, 0, h)
y2 = np.clip(y + self.length // 2, 0, h)
x1 = np.clip(x - self.length // 2, 0, w)
x2 = np.clip(x + self.length // 2, 0, w)
mask[y1: y2, x1: x2] = 0.
mask = torch.from_numpy(mask)
mask = mask.expand_as(img)
img *= mask
return img
def _data_transforms_cifar10(cutout,cutout_length):
CIFAR_MEAN = [0.49139968, 0.48215827, 0.44653124]
CIFAR_STD = [0.24703233, 0.24348505, 0.26158768]
train_transform = transforms.Compose([
transforms.RandomCrop(32, padding=4),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize(CIFAR_MEAN, CIFAR_STD),
])
if cutout:
train_transform.transforms.append(Cutout(cutout_length))
valid_transform = transforms.Compose([
transforms.ToTensor(),
transforms.Normalize(CIFAR_MEAN, CIFAR_STD),
])
return train_transform, valid_transform
_, test_transform = _data_transforms_cifar10(True,16)
test_data = dset.CIFAR10(root="../data", train=False, download=True, transform=test_transform)
test_queue = torch.utils.data.DataLoader(test_data, batch_size=96, shuffle=False, pin_memory=True, num_workers=2)
targets_all = []
for step, (input, target) in enumerate(test_queue):
input = Variable(input, volatile=True).cuda()
targets = Variable(target, volatile=True).cuda(async=True)
targets = targets.cpu().detach().numpy()
targets_all.extend(targets)
#print(targets)
from sklearn.metrics import accuracy_score
from sklearn.metrics import confusion_matrix
import copy
acc_darts_all = []
acc_1_all = []
acc_2_all = []
acc_3_all = []
acc_ensemble_all = []
for x in range(50):
logits_darts = pickle.load( open( path_logits_darts + "/logits_"+str(x)+".p", "rb" ) )
print(type(logits_darts))
logits1 = pickle.load( open( path_logits1 + "/logits_"+str(x)+".p", "rb" ) )
logits2 = pickle.load( open( path_logits2 + "/logits_"+str(x)+".p", "rb" ) )
logits3 = pickle.load( open( path_logits3 + "/logits_"+str(x)+".p", "rb" ) )
logits = copy.deepcopy(logits1)
for i in range(len(logits)):
for j in range(len(logits[i])):
logits[i][j] = logits[i][j] + logits2[i][j] + logits3[i][j]
predicted_darts_all = []
for out in logits_darts:
_, predicted = torch.max(out.data, 1)
preds = predicted.cpu().detach().numpy()
for pred in preds:
predicted_darts_all.append(pred)
predicted1_all = []
for out in logits1:
_, predicted = torch.max(out.data, 1)
preds = predicted.cpu().detach().numpy()
for pred in preds:
predicted1_all.append(pred)
predicted2_all = []
for out in logits2:
_, predicted = torch.max(out.data, 1)
preds = predicted.cpu().detach().numpy()
for pred in preds:
predicted2_all.append(pred)
predicted3_all = []
for out in logits3:
_, predicted = torch.max(out.data, 1)
preds = predicted.cpu().detach().numpy()
for pred in preds:
predicted3_all.append(pred)
predicted_all = []
for out in logits:
_, predicted = torch.max(out.data, 1)
preds = predicted.cpu().detach().numpy()
for pred in preds:
predicted_all.append(pred)
acc_darts_all.append(100*accuracy_score(predicted_darts_all,targets_all))
acc_1_all.append(100*accuracy_score(predicted1_all,targets_all))
acc_2_all.append(100*accuracy_score(predicted2_all,targets_all))
acc_3_all.append(100*accuracy_score(predicted3_all,targets_all))
acc_ensemble_all.append(100*accuracy_score(predicted_all,targets_all))
#prec1, prec5 = accuracy(predicted_all, target_all)
logging.info('test acc space 1 epoch %d %f',x,100* accuracy_score(predicted1_all,targets_all))
logging.info('test acc space 2 epoch %d %f',x,100* accuracy_score(predicted2_all,targets_all))
logging.info('test acc space 3 epoch %d %f',x,100* accuracy_score(predicted3_all,targets_all))
logging.info('test ensemble acc epoch %d %f',x,100* accuracy_score(predicted_all,targets_all))
logging.info('test darts acc epoch %d %f',x, 100*accuracy_score(predicted_darts_all,targets_all))
| 31.947977 | 113 | 0.692781 | 790 | 5,527 | 4.663291 | 0.259494 | 0.032573 | 0.043431 | 0.014929 | 0.330076 | 0.299403 | 0.279316 | 0.202497 | 0.115364 | 0.09582 | 0 | 0.037279 | 0.170074 | 5,527 | 172 | 114 | 32.133721 | 0.76586 | 0.015379 | 0 | 0.175573 | 1 | 0 | 0.058522 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.167939 | null | null | 0.007634 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
de997ae763be8a1eaf0f0b768ced10bcb802ee14 | 509 | py | Python | a2j/util.py | Rhinoffensive/aoe2record-to-json | 24cd4698cb8b2b0ca91de21c404c2d332892e17b | [
"MIT"
] | null | null | null | a2j/util.py | Rhinoffensive/aoe2record-to-json | 24cd4698cb8b2b0ca91de21c404c2d332892e17b | [
"MIT"
] | null | null | null | a2j/util.py | Rhinoffensive/aoe2record-to-json | 24cd4698cb8b2b0ca91de21c404c2d332892e17b | [
"MIT"
] | null | null | null | """
aoe2record-to-json utility functions.
"""
def is_record(path: str) -> bool:
"""
Is filename a record file?
:param (str) path: User-supplied filename.
:return: True if filename is valid record file; otherwise False.
:rtype: bool
"""
return path.find("..") == -1
def record(path: str) -> str:
"""
Get record file path by filename.
:param path: User-supplied filename.
:return: User-supplied record file.
:rtype: str
"""
return "records/" + path
| 19.576923 | 68 | 0.611002 | 64 | 509 | 4.84375 | 0.453125 | 0.129032 | 0.083871 | 0.154839 | 0.193548 | 0 | 0 | 0 | 0 | 0 | 0 | 0.005236 | 0.249509 | 509 | 25 | 69 | 20.36 | 0.806283 | 0.601179 | 0 | 0 | 0 | 0 | 0.070922 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.5 | false | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
de9a5f54f1a87a1617cb4f92fe0dd2f02f96d279 | 253 | py | Python | registration/urls.py | openstack-kr/openinfradays-2018 | 9eb0e284ab95e177dc4acca17d63ccbdaff67fb1 | [
"Apache-2.0"
] | null | null | null | registration/urls.py | openstack-kr/openinfradays-2018 | 9eb0e284ab95e177dc4acca17d63ccbdaff67fb1 | [
"Apache-2.0"
] | 1 | 2018-06-17T02:21:41.000Z | 2018-06-17T02:21:41.000Z | registration/urls.py | openstack-kr/openinfradays-2018 | 9eb0e284ab95e177dc4acca17d63ccbdaff67fb1 | [
"Apache-2.0"
] | 1 | 2018-05-31T11:39:02.000Z | 2018-05-31T11:39:02.000Z | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^invite', views.invite, name='invite'),
url(r'^check', views.check, name='check'),
url(r'^process', views.register_invite_ticket, name='register_invite_ticket'),
]
| 25.3 | 82 | 0.695652 | 35 | 253 | 4.914286 | 0.428571 | 0.069767 | 0.232558 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.13834 | 253 | 9 | 83 | 28.111111 | 0.788991 | 0 | 0 | 0 | 0 | 0 | 0.213439 | 0.086957 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.285714 | 0 | 0 | 0 | 0 | null | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
de9ba72c80aa5ccfafe814363dc5b063169a0254 | 564 | py | Python | Chapter15/azure_ml/wind_turbine/core.py | NAzT/Hands-On-Industrial-Internet-of-Things | 4dddfee1d54a200c6325f3138b74d2bd90810a92 | [
"MIT"
] | 51 | 2018-10-06T03:02:33.000Z | 2022-03-26T09:16:49.000Z | Chapter15/azure_ml/wind_turbine/core.py | NAzT/Hands-On-Industrial-Internet-of-Things | 4dddfee1d54a200c6325f3138b74d2bd90810a92 | [
"MIT"
] | 7 | 2021-04-16T20:10:02.000Z | 2022-03-24T17:38:22.000Z | Chapter15/azure_ml/wind_turbine/core.py | NAzT/Hands-On-Industrial-Internet-of-Things | 4dddfee1d54a200c6325f3138b74d2bd90810a92 | [
"MIT"
] | 30 | 2018-12-12T16:45:20.000Z | 2022-01-30T00:14:57.000Z | import json
import numpy as np
import os
import pickle
from azureml.core.model import Model
def wind_turbine_model(x):
# cut-in speed vs cut-out speed
if x<4.5 or x>21.5:
return 0.0
# standard operability
return 376.936 - 195.8161*x + 33.75734*x**2 - 2.212492*x**3 + 0.06309095*x**4 - 0.0006533647*x**5
def init():
global model
# not model for wind turbine
model = wind_turbine_model
def run(raw_data):
data = np.array(json.loads(raw_data)['data'])
# make evaluation
y = model(data)
return json.dumps(y)
| 19.448276 | 101 | 0.656028 | 97 | 564 | 3.752577 | 0.546392 | 0.090659 | 0.131868 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.133333 | 0.228723 | 564 | 28 | 102 | 20.142857 | 0.703448 | 0.164894 | 0 | 0 | 0 | 0 | 0.008584 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.1875 | false | 0 | 0.3125 | 0 | 0.6875 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
de9d145a6c7023c3bcf7fd78db992564d2c725d1 | 2,229 | py | Python | ticketapp/ticket_app/migrations/0002_auto_20190703_2134.py | tomeklewandowski/ticketapp | 372f2a29d40f052ac7cfdfe6e4814f782338f19c | [
"Apache-2.0"
] | null | null | null | ticketapp/ticket_app/migrations/0002_auto_20190703_2134.py | tomeklewandowski/ticketapp | 372f2a29d40f052ac7cfdfe6e4814f782338f19c | [
"Apache-2.0"
] | null | null | null | ticketapp/ticket_app/migrations/0002_auto_20190703_2134.py | tomeklewandowski/ticketapp | 372f2a29d40f052ac7cfdfe6e4814f782338f19c | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2.3 on 2019-07-03 21:34
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('ticket_app', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='event',
name='date',
field=models.DateTimeField(null=True),
),
migrations.AddField(
model_name='event',
name='name',
field=models.CharField(default='Event', max_length=256),
),
migrations.AddField(
model_name='event',
name='types',
field=models.TextField(default=None, null=True),
),
migrations.AddField(
model_name='ticket',
name='event',
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='ticket_app.Event'),
),
migrations.AddField(
model_name='ticket',
name='price',
field=models.DecimalField(decimal_places=2, default=0, max_digits=15),
),
migrations.AddField(
model_name='ticket',
name='reservation_date',
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
preserve_default=False,
),
migrations.AddField(
model_name='ticket',
name='reservation_status',
field=models.IntegerField(choices=[('1', 'Available'), ('2', 'Reserved'), ('3', 'Paid')], default=1),
),
migrations.AddField(
model_name='ticket',
name='ticket_type',
field=models.IntegerField(choices=[('1', 'Regular'), ('2', 'Premium'), ('3', 'VIP'), ('4', 'Reduced')], default=0),
preserve_default=False,
),
migrations.AlterField(
model_name='event',
name='id',
field=models.AutoField(primary_key=True, serialize=False),
),
migrations.AlterField(
model_name='ticket',
name='id',
field=models.AutoField(primary_key=True, serialize=False),
),
]
| 32.779412 | 127 | 0.558546 | 217 | 2,229 | 5.617512 | 0.368664 | 0.073831 | 0.150943 | 0.177194 | 0.462674 | 0.360131 | 0.16735 | 0.088597 | 0.088597 | 0.088597 | 0 | 0.022552 | 0.303724 | 2,229 | 67 | 128 | 33.268657 | 0.762887 | 0.020188 | 0 | 0.590164 | 1 | 0 | 0.1022 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.04918 | 0 | 0.098361 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
de9ec4d27ea7a6ea6cec7cb835e49c2014cac625 | 2,319 | py | Python | lib/event.py | PaulMndn/Fenrir-Discord-Bot | 28b604ee4ee9d3643a091472f96c899abc6c0b36 | [
"MIT"
] | 1 | 2021-06-27T14:01:49.000Z | 2021-06-27T14:01:49.000Z | lib/event.py | PaulMndn/Fenrir-Discord-Bot | 28b604ee4ee9d3643a091472f96c899abc6c0b36 | [
"MIT"
] | 7 | 2021-09-17T22:04:57.000Z | 2022-01-25T16:46:30.000Z | lib/event.py | PaulMndn/Fenrir-Discord-Bot | 28b604ee4ee9d3643a091472f96c899abc6c0b36 | [
"MIT"
] | 1 | 2021-05-13T17:38:19.000Z | 2021-05-13T17:38:19.000Z | import discord
import datetime as dt
class Event:
def __init__(self, title: str, date_time: dt.datetime, event_channel_id: int, msg_id: int = None):
self.title = title
self.date_time = date_time
self.event_channel_id = event_channel_id
self.msg_id = msg_id
def __str__(self):
return f"**{self.title}** {self.date_time.strftime('%d.%m.%Y at %I:%M%p')}"
def __lt__(self, other):
if isinstance(other, Event):
return self.date_time < other.date_time
elif isinstance(other, dt.datetime):
return self.date_time < other
elif isinstance(other, dt.date):
return self.date_time.date() < other
else:
raise NotImplementedError(f"Can't compare type '{type(self)}'v to type '{type(other)}'.")
def __le__(self, other):
if isinstance(other, Event):
return self.date_time <= other.date_time
elif isinstance(other, dt.datetime):
return self.date_time <= other
elif isinstance(other, dt.date):
return self.date_time.date() <= other
else:
raise NotImplementedError(f"Can't compare type '{type(self)}' to type '{type(other)}'.")
def __ge__(self, other):
if isinstance(other, Event):
return self.date_time >= other.date_time
elif isinstance(other, dt.datetime):
return self.date_time >= other
elif isinstance(other, dt.date):
return self.date_time.date() >= other
else:
raise NotImplementedError(f"Can't compare type '{type(self)}' to type '{type(other)}'.")
def __eq__(self, other):
if isinstance(other, Event):
return self.date_time == other.date_time
elif isinstance(other, dt.datetime):
return self.date_time == other
elif isinstance(other, dt.date):
return self.date_time.date() == other
else:
raise NotImplementedError(f"Can't compare type '{type(self)}' to type '{type(other)}'.")
@property
def key(self):
'''Message ID if it exists. Otherwise the datetime in iso-format.'''
return str(self.msg_id) if self.msg_id is not None else self.date_time.isoformat()
if __name__ == "__main__":
pass | 35.676923 | 102 | 0.605002 | 300 | 2,319 | 4.463333 | 0.203333 | 0.125467 | 0.134429 | 0.161314 | 0.702763 | 0.68932 | 0.68932 | 0.68932 | 0.68932 | 0.68932 | 0 | 0 | 0.276843 | 2,319 | 65 | 103 | 35.676923 | 0.79845 | 0.026736 | 0 | 0.372549 | 0 | 0.019608 | 0.135879 | 0.015098 | 0 | 0 | 0 | 0 | 0 | 1 | 0.137255 | false | 0.019608 | 0.039216 | 0.019608 | 0.470588 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
dea54aebb8fe43af5d6a1a240db366a6f22092e3 | 1,105 | py | Python | flair/migrations/0017_actionlogging.py | r-anime/flairsite | 4c34800ed5a516b2e988edd2eed97dadf592a57f | [
"MIT"
] | 3 | 2021-11-24T02:20:28.000Z | 2022-02-15T04:25:11.000Z | flair/migrations/0017_actionlogging.py | r-anime/flairsite | 4c34800ed5a516b2e988edd2eed97dadf592a57f | [
"MIT"
] | 15 | 2021-05-30T18:03:37.000Z | 2022-02-03T16:33:05.000Z | flair/migrations/0017_actionlogging.py | r-anime/flairsite | 4c34800ed5a516b2e988edd2eed97dadf592a57f | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-05-11 08:17
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('flair', '0016_auto_20210502_0028'),
]
operations = [
migrations.CreateModel(
name='ActionLogging',
fields=[
('id', models.BigAutoField(primary_key=True, serialize=False)),
('action', models.CharField(max_length=256, verbose_name='Action attempted.')),
('action_info', models.CharField(max_length=256, verbose_name='Info related to the action.')),
('reddit_name', models.CharField(max_length=20, verbose_name='Redditor name.')),
('error', models.CharField(max_length=256, verbose_name='Error message.')),
('current_flair', models.CharField(max_length=256, verbose_name='Current user flair if relevant.')),
('timestamp', models.DateTimeField(default=django.utils.timezone.now, verbose_name='Timestamp at database insert time.')),
],
),
]
| 40.925926 | 138 | 0.632579 | 120 | 1,105 | 5.675 | 0.558333 | 0.096916 | 0.132159 | 0.176211 | 0.223201 | 0.223201 | 0.223201 | 0 | 0 | 0 | 0 | 0.053318 | 0.236199 | 1,105 | 26 | 139 | 42.5 | 0.753555 | 0.040724 | 0 | 0 | 1 | 0 | 0.222117 | 0.021739 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.1 | 0 | 0.25 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
deb00ff498e7c36c86b18188a8a3c2229ea477cc | 232 | py | Python | tests/vcr_config.py | AartGoossens/goldencheetahlib | ebe57de7d94280674c8440a81f53ac02f0b4eb43 | [
"MIT"
] | 1 | 2018-09-15T00:46:18.000Z | 2018-09-15T00:46:18.000Z | tests/vcr_config.py | AartGoossens/goldencheetahlib | ebe57de7d94280674c8440a81f53ac02f0b4eb43 | [
"MIT"
] | 8 | 2016-08-17T08:02:03.000Z | 2017-11-06T18:42:21.000Z | tests/vcr_config.py | AartGoossens/goldencheetahlib | ebe57de7d94280674c8440a81f53ac02f0b4eb43 | [
"MIT"
] | 1 | 2019-10-15T13:28:29.000Z | 2019-10-15T13:28:29.000Z | import vcr
# Set to True to enable 'once' mock recording
MOCK_RECORDING_ENABLED = False
vcr = vcr.VCR(
cassette_library_dir='tests/mock/',
record_mode='once' if MOCK_RECORDING_ENABLED else 'none',
match_on=['uri'],
)
| 19.333333 | 61 | 0.715517 | 34 | 232 | 4.647059 | 0.676471 | 0.246835 | 0.253165 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.172414 | 232 | 11 | 62 | 21.090909 | 0.822917 | 0.185345 | 0 | 0 | 0 | 0 | 0.117647 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.142857 | 0 | 0.142857 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
deb3edc6f8136b449fc005035fdcf021b4899b2e | 321 | py | Python | tasking/customers/models.py | cmanallen/tasking | 0a613357148afdb4b55078c58429ec45bb60a436 | [
"MIT"
] | null | null | null | tasking/customers/models.py | cmanallen/tasking | 0a613357148afdb4b55078c58429ec45bb60a436 | [
"MIT"
] | null | null | null | tasking/customers/models.py | cmanallen/tasking | 0a613357148afdb4b55078c58429ec45bb60a436 | [
"MIT"
] | null | null | null | from django.db import models
from tenant_schemas.models import TenantMixin
class Client(TenantMixin):
name = models.CharField(max_length=255)
email = models.EmailField(max_length=255)
phone = models.CharField(max_length=255, blank=True)
trial = models.BooleanField()
expiration = models.DateField(blank=True) | 29.181818 | 54 | 0.785047 | 42 | 321 | 5.904762 | 0.571429 | 0.108871 | 0.145161 | 0.193548 | 0.217742 | 0 | 0 | 0 | 0 | 0 | 0 | 0.031802 | 0.11838 | 321 | 11 | 55 | 29.181818 | 0.844523 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.25 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
dec02a7b795c0951639694ff315bb3b1a4395f45 | 966 | py | Python | hospital/migrations/0009_doctor_experience.py | md-arru/Heart-Care-System | b7b8472f7b8ea289c8bea5fe00c2856af159f46b | [
"MIT"
] | 20 | 2019-11-26T12:33:25.000Z | 2021-09-02T16:03:59.000Z | hospital/migrations/0009_doctor_experience.py | md-arru/Heart-Care-System | b7b8472f7b8ea289c8bea5fe00c2856af159f46b | [
"MIT"
] | 14 | 2019-08-23T15:12:34.000Z | 2022-03-11T23:46:34.000Z | hospital/migrations/0009_doctor_experience.py | md-arru/Heart-Care-System | b7b8472f7b8ea289c8bea5fe00c2856af159f46b | [
"MIT"
] | 23 | 2019-08-19T01:12:25.000Z | 2022-03-08T12:53:44.000Z | # Generated by Django 2.2 on 2019-05-01 15:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hospital', '0008_doctor_picture'),
]
operations = [
migrations.AddField(
model_name='doctor',
name='experience',
field=models.TextField(default='Etiam porta sem malesuada magna mollis euismod. Cras mattis consectetur purus sit amet fermentum. Donec ullamcorper nulla non metus auctor fringilla. Vestibulum id ligula porta felis euismod semper. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Donec id elit non mi porta gravida at eget metus. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Lorem ipsum dolor sit amet, consectetur adipiscing elit.'),
preserve_default=False,
),
]
| 48.3 | 597 | 0.722567 | 124 | 966 | 5.596774 | 0.741935 | 0.030259 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.023684 | 0.213251 | 966 | 19 | 598 | 50.842105 | 0.889474 | 0.044513 | 0 | 0 | 1 | 0.076923 | 0.643865 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.076923 | 0 | 0.307692 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
dec7cf2f912c739186a1c4132f3109085e0cb289 | 193 | py | Python | algorithm/hash/horner_hash.py | joway/PyAlgorithm | 0420fbcbebad3b746db63b9e9a5878b4af8ad6ac | [
"MIT"
] | 1 | 2016-08-23T14:24:44.000Z | 2016-08-23T14:24:44.000Z | algorithm/hash/horner_hash.py | joway/PyAlgorithm | 0420fbcbebad3b746db63b9e9a5878b4af8ad6ac | [
"MIT"
] | null | null | null | algorithm/hash/horner_hash.py | joway/PyAlgorithm | 0420fbcbebad3b746db63b9e9a5878b4af8ad6ac | [
"MIT"
] | null | null | null | from algorithm.calculation.horner import horner
def horner_hash(key, size):
_BASE = 32
return horner(key, _BASE) % size
if __name__ == '__main__':
print(horner_hash('test', 10))
| 19.3 | 47 | 0.694301 | 26 | 193 | 4.692308 | 0.692308 | 0.163934 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.025478 | 0.186529 | 193 | 9 | 48 | 21.444444 | 0.751592 | 0 | 0 | 0 | 0 | 0 | 0.062176 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.166667 | 0 | 0.5 | 0.166667 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
dec900d1c692ce477009a32f1208e08dca0e1342 | 1,682 | py | Python | cgi-bin/html_render.py | NyanHtooTha/python_e-library | be10206632765c39b708c3d7c8c6a28996f3a142 | [
"MIT"
] | null | null | null | cgi-bin/html_render.py | NyanHtooTha/python_e-library | be10206632765c39b708c3d7c8c6a28996f3a142 | [
"MIT"
] | null | null | null | cgi-bin/html_render.py | NyanHtooTha/python_e-library | be10206632765c39b708c3d7c8c6a28996f3a142 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from string import Template
def start_response(resp="text/html"):
return('Content-type: ' + resp + '\n\n')
def include_header(the_title):
with open('templates/template.html') as headf:
head_text = headf.read()
header = Template(head_text)
return(header.substitute(title=the_title))
def u_list_one(book_type):
return('<ul><li class="one">%s</li></ul>' %book_type)
def u_list_menu(items):
u_string = '<ul>'
for item in items:
u_string += '<li><a><input onclick="bookmenu.submit();" type="submit" name="booktype" value="%s"></a></li>' %item
u_string += '</ul>'
return(u_string)
def start_form(the_url, menu=False):
if menu:
return('<form id="bookmenu" action="%s" method="POST">' %the_url)
else:
return('<form action="%s" method="POST">' %the_url)
def end_form():
return('</form>')
def make_book_gallery(items, recommend=False):
book_gallery = ''
if not recommend:
for image in items:
book_gallery += '<div class="gallery"><a href="/%s" target="_blank"><img src="/%s"></a><div class="desc"><button name="bookname" value="/%s">Read</button></div></div>' %(image, image, image)
return book_gallery
else:
for book in items:
image = book.replace('.pdf', '.jpg')
book_gallery += '<div style="display: inline-block;"><div class="gallery"><a href="%s" target="_blank"><img src="%s"></a><div class="desc"><button name="bookname" value="%s">Read</button></div></div></div>' %(image, image, book)
return book_gallery
def blank_line():
return('</br>')
def end_response():
return('</body></html>')
| 32.980392 | 240 | 0.61415 | 236 | 1,682 | 4.241525 | 0.355932 | 0.065934 | 0.015984 | 0.033966 | 0.22977 | 0.22977 | 0.183816 | 0.183816 | 0.183816 | 0.183816 | 0 | 0.000729 | 0.184304 | 1,682 | 50 | 241 | 33.64 | 0.728863 | 0.010107 | 0 | 0.105263 | 0 | 0.078947 | 0.380637 | 0.092604 | 0 | 0 | 0 | 0 | 0 | 1 | 0.236842 | false | 0 | 0.026316 | 0.131579 | 0.315789 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
dec994c8b7d5d7cba5f32d59a25d10e77c4f643c | 259 | py | Python | task/urls.py | DevTotti/monkey-todo-app | a539fee7c413a8c62a08a1bfa282cf0f04d01e3b | [
"MIT"
] | null | null | null | task/urls.py | DevTotti/monkey-todo-app | a539fee7c413a8c62a08a1bfa282cf0f04d01e3b | [
"MIT"
] | null | null | null | task/urls.py | DevTotti/monkey-todo-app | a539fee7c413a8c62a08a1bfa282cf0f04d01e3b | [
"MIT"
] | null | null | null | from django.urls import path
from .views import TodoView, TodoRetrieveView
urlpatterns = [
path('<user_id>/create/', TodoView.as_view()),
path('<user_id>/', TodoRetrieveView.as_view()),
path('<user_id>/<todo_id>/', TodoRetrieveView.as_view()),
] | 28.777778 | 61 | 0.698842 | 32 | 259 | 5.4375 | 0.46875 | 0.137931 | 0.172414 | 0.16092 | 0.183908 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.123552 | 259 | 9 | 62 | 28.777778 | 0.76652 | 0 | 0 | 0 | 0 | 0 | 0.180769 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.285714 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
decc4a6eb71bfb63f8f4e51ab5b2c616daf80870 | 346 | py | Python | tests/test_day14.py | khwilson/advent2021 | 6499b883f1b6d7366f3fe75dc229d646154a4cf8 | [
"MIT"
] | null | null | null | tests/test_day14.py | khwilson/advent2021 | 6499b883f1b6d7366f3fe75dc229d646154a4cf8 | [
"MIT"
] | null | null | null | tests/test_day14.py | khwilson/advent2021 | 6499b883f1b6d7366f3fe75dc229d646154a4cf8 | [
"MIT"
] | null | null | null | from pathlib import Path
from advent.solutions import day14
def test_part1(fixtures_path: Path):
solution = day14.Day14(fixtures_path / "test_input14.txt")
assert solution.part1() == 1588
def test_part2(fixtures_path: Path):
solution = day14.Day14(fixtures_path / "test_input14.txt")
assert solution.part2() == 2188189693529
| 24.714286 | 62 | 0.745665 | 45 | 346 | 5.555556 | 0.4 | 0.192 | 0.128 | 0.192 | 0.592 | 0.592 | 0.592 | 0.592 | 0.592 | 0.592 | 0 | 0.119454 | 0.153179 | 346 | 13 | 63 | 26.615385 | 0.733788 | 0 | 0 | 0.25 | 0 | 0 | 0.092486 | 0 | 0 | 0 | 0 | 0 | 0.25 | 1 | 0.25 | false | 0 | 0.25 | 0 | 0.5 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
decdde6b6b5f673a36b39bc3f9622d17e8722d5b | 318 | py | Python | stack_manager.py | jdbooth9516/sweepstakes | d6d5f9baca9ea72dcc372c34f767cef1bfe91c0b | [
"MIT"
] | null | null | null | stack_manager.py | jdbooth9516/sweepstakes | d6d5f9baca9ea72dcc372c34f767cef1bfe91c0b | [
"MIT"
] | null | null | null | stack_manager.py | jdbooth9516/sweepstakes | d6d5f9baca9ea72dcc372c34f767cef1bfe91c0b | [
"MIT"
] | null | null | null | from stack import Stack
class Stack_manager:
def __init__(self):
self.stack = Stack()
def insert_sweepstake(self, sweepstake):
self.stack.push(sweepstake)
def get_sweepstake(self):
return self.stack.pop()
#create insert sweepstakes and get sweepstakes method.
| 21.2 | 58 | 0.657233 | 37 | 318 | 5.459459 | 0.486486 | 0.133663 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.264151 | 318 | 15 | 59 | 21.2 | 0.863248 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.375 | false | 0 | 0.125 | 0.125 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
dece51f1d4db89356ab73075b0ed77f93d7f63e7 | 1,156 | py | Python | compiled/construct/switch_manual_enum_invalid_else.py | smarek/ci_targets | c5edee7b0901fd8e7f75f85245ea4209b38e0cb3 | [
"MIT"
] | 4 | 2017-04-08T12:55:11.000Z | 2020-12-05T21:09:31.000Z | compiled/construct/switch_manual_enum_invalid_else.py | smarek/ci_targets | c5edee7b0901fd8e7f75f85245ea4209b38e0cb3 | [
"MIT"
] | 7 | 2018-04-23T01:30:33.000Z | 2020-10-30T23:56:14.000Z | compiled/construct/switch_manual_enum_invalid_else.py | smarek/ci_targets | c5edee7b0901fd8e7f75f85245ea4209b38e0cb3 | [
"MIT"
] | 6 | 2017-04-08T11:41:14.000Z | 2020-10-30T22:47:31.000Z | from construct import *
from construct.lib import *
switch_manual_enum_invalid_else__opcode__intval = Struct(
'value' / Int8ub,
)
switch_manual_enum_invalid_else__opcode__strval = Struct(
'value' / NullTerminated(GreedyString(encoding='ASCII'), term=b'\x00', include=False, consume=True),
)
switch_manual_enum_invalid_else__opcode__defval = Struct(
'value' / Computed(lambda this: 123),
)
def switch_manual_enum_invalid_else__opcode__code_enum(subcon):
return Enum(subcon,
intval=73,
strval=83,
)
switch_manual_enum_invalid_else__opcode = Struct(
'code' / switch_manual_enum_invalid_else__opcode__code_enum(Int8ub),
'body' / Switch(this.code, {SwitchManualEnumInvalidElse.Opcode.CodeEnum.intval: LazyBound(lambda: switch_manual_enum_invalid_else__opcode__intval), SwitchManualEnumInvalidElse.Opcode.CodeEnum.strval: LazyBound(lambda: switch_manual_enum_invalid_else__opcode__strval), }, default=LazyBound(lambda: switch_manual_enum_invalid_else__opcode__defval)),
)
switch_manual_enum_invalid_else = Struct(
'opcodes' / GreedyRange(LazyBound(lambda: switch_manual_enum_invalid_else__opcode)),
)
_schema = switch_manual_enum_invalid_else
| 36.125 | 348 | 0.83045 | 146 | 1,156 | 5.979452 | 0.308219 | 0.164948 | 0.219931 | 0.316151 | 0.568156 | 0.5063 | 0.468499 | 0.31386 | 0 | 0 | 0 | 0.010319 | 0.077855 | 1,156 | 31 | 349 | 37.290323 | 0.80863 | 0 | 0 | 0 | 0 | 0 | 0.033737 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.041667 | false | 0 | 0.083333 | 0.041667 | 0.166667 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
deec0e36ee41c7496e67cf38615c214d53463471 | 4,831 | py | Python | tests/data/jacob/generate_remove_accents_tests.py | planlodge/ChowNow-Theme-Wordpress | 0e3e303013191c395d359d15fc40aff324e71e03 | [
"Apache-2.0"
] | 1 | 2018-04-18T01:11:58.000Z | 2018-04-18T01:11:58.000Z | tests/data/jacob/generate_remove_accents_tests.py | planlodge/ChowNow-Theme-Wordpress | 0e3e303013191c395d359d15fc40aff324e71e03 | [
"Apache-2.0"
] | null | null | null | tests/data/jacob/generate_remove_accents_tests.py | planlodge/ChowNow-Theme-Wordpress | 0e3e303013191c395d359d15fc40aff324e71e03 | [
"Apache-2.0"
] | null | null | null | import unicodedata, codecs
# Generates testdata for the WordPress `remove_accents` function.
#
# Unicode defines character decompositions: e.g., an
# e with an umlaut (LATIN SMALL LETTER E WITH DIAERESIS) decomposes
# to 0x0065 (LATIN SMALL LETTER E) and 0x0308 (COMBINING DIAERESIS).
#
# Some characters aren't decomposable, but still have ASCII
# representations, e.g. the "ae" ligature should be written as "ae".
#
#
# This code derives from the work of Fredrik Lundh / effbot
# <http://effbot.org/zone/unicode-convert.htm>
#
# He uses different replacements ("d" for eth, "oe" for o-with-stroke, etc.)
# but the below follows Wordpress's behaviour.
#
CHAR_REPLACEMENT = {
# latin-1 characters that don't have a unicode decomposition
0xc6: u"AE", # LATIN CAPITAL LETTER AE
0xd0: u"DH", # LATIN CAPITAL LETTER ETH
0xd8: u"O", # LATIN CAPITAL LETTER O WITH STROKE
0xde: u"TH", # LATIN CAPITAL LETTER THORN
0xdf: u"ss", # LATIN SMALL LETTER SHARP S
0xe6: u"ae", # LATIN SMALL LETTER AE
0xf0: u"dh", # LATIN SMALL LETTER ETH
0xf8: u"o", # LATIN SMALL LETTER O WITH STROKE
0xfe: u"th", # LATIN SMALL LETTER THORN
0x13f: u"L", # LATIN CAPITAL LETTER L WITH MIDDLE DOT
0x140: u"l", # LATIN SMALL LETTER L WITH MIDDLE DOT
0x149: u"N" # LATIN SMALL LETTER N PRECEDED BY APOSTROPHE
}
# Latin-1 Supplement (0080-00FF): identical to ISO-8859-1.
# 0080009F are control characters, 00A000BF are currency symbols,
# punctuation and numerals.
latin1_supplement = map(unichr, range(0x00C0, 0x0100))
# Latin Extended-A 0100017F
latin_extended_a = map(unichr, range(0x0100, 0x0180))
def remove_accents(chars):
"""Divides a given string into decomposable and undecomposable characters."""
decomposable = []
undecomposable = []
for c in chars:
de = unicodedata.decomposition(c)
if de:
dechars = de.split(None)
try:
# Only keep characters with a decimal value < 300
dechars = map(lambda i: int(i, 16), dechars)
dechars = filter(lambda i: i < 300, dechars)
dechars = map(unichr, dechars)
de = "".join(dechars)
except (IndexError, ValueError):
if ord(c) in CHAR_REPLACEMENT:
de = CHAR_REPLACEMENT[ord(c)]
else:
dechars = filter(lambda s: s[0] != "<", dechars)
dechars = map(lambda i: int(i, 16), dechars)
dechars = map(unichr, dechars)
de = "".join(dechars)
undecomposable.append((c, de))
else:
decomposable.append((c, de))
else:
if ord(c) in CHAR_REPLACEMENT:
de = CHAR_REPLACEMENT[ord(c)]
undecomposable.append((c, de))
return decomposable, undecomposable
def write_cases(case, data, in_encoding="utf-8", out_encoding="utf-8"):
if not isinstance(data[0], list):
data = [data]
print "generating %s data" % case
infile = codecs.open(case + ".input.txt", "w", in_encoding)
outfile = codecs.open(case + ".output.txt", "w", out_encoding)
for data_ in data:
inline, outline = zip(*data_)
infile.write("".join(inline) + "\n")
outfile.write("".join(outline) + "\n")
infile.close()
outfile.close()
if __name__ == "__main__":
l1s_decomposable, l1s_undecomposable = remove_accents(latin1_supplement)
l1s_both = l1s_decomposable + l1s_undecomposable
lea_decomposable, lea_undecomposable = remove_accents(latin_extended_a)
lea_both = lea_decomposable + lea_undecomposable
write_cases("removes_accents_from_decomposable_latin1_supplement",
l1s_decomposable, in_encoding="iso-8859-1", out_encoding="ascii")
write_cases("removes_accents_from_undecomposable_latin1_supplement",
l1s_undecomposable, in_encoding="iso-8859-1", out_encoding="ascii")
write_cases("removes_accents_from_latin1_supplement",
l1s_both, in_encoding="iso-8859-1", out_encoding="ascii")
write_cases("removes_accents_from_decomposable_latin_extended_a",
lea_decomposable, in_encoding="utf-8", out_encoding="ascii")
write_cases("removes_accents_from_undecomposable_latin_extended_a",
lea_undecomposable, in_encoding="utf-8", out_encoding="ascii")
write_cases("removes_accents_from_latin_extended_a",
lea_both, in_encoding="utf-8", out_encoding="ascii")
write_cases("removes_accents_from_latin1_supplement_and_latin_extended_a",
l1s_both + lea_both, in_encoding="utf-8", out_encoding="ascii")
| 39.92562 | 82 | 0.636307 | 597 | 4,831 | 4.968174 | 0.324958 | 0.030344 | 0.04855 | 0.056642 | 0.286581 | 0.261295 | 0.235334 | 0.235334 | 0.211059 | 0.161834 | 0 | 0.037847 | 0.261644 | 4,831 | 120 | 83 | 40.258333 | 0.793664 | 0.256883 | 0 | 0.197368 | 1 | 0 | 0.151326 | 0.101281 | 0 | 0 | 0.022341 | 0 | 0 | 0 | null | null | 0 | 0.013158 | null | null | 0.013158 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
defcecc8fe1e66a5c328ed5f0af71d70376497a1 | 1,669 | py | Python | srl/base/env/genre/singleplay.py | pocokhc/simple_rl | 765f12f392f87e6897027905d74f1bced6a2b7bf | [
"MIT"
] | 1 | 2022-03-01T09:16:57.000Z | 2022-03-01T09:16:57.000Z | srl/base/env/genre/singleplay.py | pocokhc/simple_rl | 765f12f392f87e6897027905d74f1bced6a2b7bf | [
"MIT"
] | null | null | null | srl/base/env/genre/singleplay.py | pocokhc/simple_rl | 765f12f392f87e6897027905d74f1bced6a2b7bf | [
"MIT"
] | null | null | null | from abc import abstractmethod
from typing import List, Tuple
import numpy as np
from srl.base.define import EnvAction, EnvObservation, Info
from srl.base.env import EnvBase
class SinglePlayEnv(EnvBase):
# -----------------------------------------------------
# inheritance target implementation(継承先に必要な実装)
# -----------------------------------------------------
# @property (define parent)
# action_space : SpaceBase
# observation_space : SpaceBase
# observation_type : EnvObservationType
# max_episode_steps : int
#
# functions (define parent)
# (abstractmethod)
# backup
# restore
# (option)
# close
# render_terminal
# render_gui
# render_rgb_array
# get_invalid_actions
# action_to_str
# make_worker
@abstractmethod # new method
def call_reset(self) -> np.ndarray:
raise NotImplementedError()
@abstractmethod # new method
def call_step(self, action: EnvAction) -> Tuple[np.ndarray, float, bool, Info]:
raise NotImplementedError()
# -----------------------------------------------------
# inherit implementation(継承元の実装)
# -----------------------------------------------------
@property
def player_num(self) -> int:
return 1
def reset(self) -> Tuple[np.ndarray, List[int]]:
return self.call_reset(), [0]
def step(
self,
actions: List[EnvAction],
player_indices: List[int],
) -> Tuple[EnvObservation, List[float], bool, List[int], Info]:
n_state, reward, done, info = self.call_step(actions[0])
return n_state, [reward], done, [0], info
| 28.775862 | 83 | 0.558418 | 160 | 1,669 | 5.6875 | 0.48125 | 0.02967 | 0.024176 | 0.057143 | 0.065934 | 0 | 0 | 0 | 0 | 0 | 0 | 0.00311 | 0.229479 | 1,669 | 57 | 84 | 29.280702 | 0.70451 | 0.379868 | 0 | 0.166667 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.208333 | false | 0 | 0.208333 | 0.083333 | 0.583333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
72053fe090103962259ec35310c1c3cd2718724e | 225 | py | Python | mysite/trips/urls.py | CXPhoenix/FirstDjangoWeb | 5001f6405874f7ca6f285b8b9b22f68c0a374469 | [
"MIT"
] | null | null | null | mysite/trips/urls.py | CXPhoenix/FirstDjangoWeb | 5001f6405874f7ca6f285b8b9b22f68c0a374469 | [
"MIT"
] | null | null | null | mysite/trips/urls.py | CXPhoenix/FirstDjangoWeb | 5001f6405874f7ca6f285b8b9b22f68c0a374469 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.home, name='index'),
path('/helloWorld', views.helloWorld, name='helloWorld'),
path('<int:pk>/', views.postDetail, name='detail'),
] | 28.125 | 61 | 0.662222 | 27 | 225 | 5.518519 | 0.555556 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.146667 | 225 | 8 | 62 | 28.125 | 0.776042 | 0 | 0 | 0 | 0 | 0 | 0.181416 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.285714 | 0 | 0.285714 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
720e5a36980e6b1c6c36fb0fc9adc106a023f2e1 | 4,041 | py | Python | system_tests/internals/objective_function/events.py | McCreaP/lss | 8e334fb794f110d01f02af3fa4b02a7d635b490d | [
"BSD-2-Clause"
] | null | null | null | system_tests/internals/objective_function/events.py | McCreaP/lss | 8e334fb794f110d01f02af3fa4b02a7d635b490d | [
"BSD-2-Clause"
] | null | null | null | system_tests/internals/objective_function/events.py | McCreaP/lss | 8e334fb794f110d01f02af3fa4b02a7d635b490d | [
"BSD-2-Clause"
] | null | null | null | import abc
import logging
from internals.machine import MachineState
LOGGER = logging.getLogger('test_runner')
class Event:
def __init__(self, execution_time):
self._execution_time = execution_time
def __lt__(self, other):
return self._execution_time < other._execution_time
def execute(self):
LOGGER.debug("Compute objective function event: %s", str(self))
value = self._execute_impl()
LOGGER.debug("Add %d to the objective function", value)
return value
def get_execution_time(self):
return self._execution_time
@abc.abstractmethod
def _execute_impl(self):
return
class StartJob(Event):
def __init__(self, job, imbalance_factor):
super(StartJob, self).__init__(job.get_start_time())
self._job = job
self._imbalance_factor = imbalance_factor
def __str__(self):
return "Start: %s at %s" % (str(self._job), self._execution_time)
def _execute_impl(self):
return -self._imbalance_factor * self.__imbalance_ingredient()
def __imbalance_ingredient(self):
fair_machine_set = self._job.get_fair_machine_set()
if not fair_machine_set:
return 0
return fair_machine_set.start_job(self._job.get_account_id(), self._execution_time)
class FinishJob(Event):
def __init__(self, job, imbalance_factor):
super(FinishJob, self).__init__(job.get_finish_time())
self._job = job
self._imbalance_factor = imbalance_factor
def __str__(self):
return "Finish: %s at %s" % (str(self._job), self._execution_time)
def _execute_impl(self):
value = -self._imbalance_factor * self.__imbalance_ingredient()
value += self.__finish_job_ingredient()
return value
def __imbalance_ingredient(self):
fair_machine_set = self._job.get_fair_machine_set()
if not fair_machine_set:
return 0
imbalance_ingredient = fair_machine_set.finish_job(self._job.get_account_id(), self._execution_time)
LOGGER.debug("Imbalance ingredient: %f", imbalance_ingredient)
return imbalance_ingredient
def __finish_job_ingredient(self):
batch = self._job.get_batch()
finish_job_ingredient = batch.finish_job(self._job)
LOGGER.debug("Finish job ingredient: %s", finish_job_ingredient)
return finish_job_ingredient
class MachineEvent(Event):
def __init__(self, machine, time, new_state, imbalance_factor):
super(MachineEvent, self).__init__(time)
self.__machine = machine
self.__new_state = new_state
self.__imbalance_factor = imbalance_factor
def __str__(self):
return "Machine event, machine id: %s, new state: %s, at %s" % \
(str(self.__machine.id), str(self.__new_state), self._execution_time)
def _execute_impl(self):
if self.__new_state == MachineState.MACHINE_DEAD:
return -self.__imbalance_factor * self.__machine.dead(self._execution_time)
else:
return -self.__imbalance_factor * self.__machine.idle(self._execution_time)
class FairSetEvent(Event):
def __init__(self, fair_set, time, new_machines, old_machines, imbalance_factor):
super(FairSetEvent, self).__init__(time)
self.__fair_set = fair_set
self.__new_machines = new_machines
self.__old_machines = old_machines
self.__imbalance_factor = imbalance_factor
def __str__(self):
return "Fair machine set event: %s at %s" % (str(self.__fair_set), self._execution_time)
def _execute_impl(self):
value = 0.
for machine in self.__new_machines:
value += self.__fair_set.add_machine(machine, self._execution_time)
machine.fair_machine_set = self.__fair_set
for machine in self.__old_machines:
value += self.__fair_set.remove_machine(machine, self._execution_time)
machine.fair_machine_set = None
return -self.__imbalance_factor * value
| 34.836207 | 108 | 0.686464 | 497 | 4,041 | 5.05835 | 0.136821 | 0.087908 | 0.09467 | 0.031822 | 0.438345 | 0.398568 | 0.336516 | 0.322593 | 0.273667 | 0.161496 | 0 | 0.000955 | 0.222965 | 4,041 | 115 | 109 | 35.13913 | 0.799682 | 0 | 0 | 0.306818 | 0 | 0 | 0.059886 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.227273 | false | 0 | 0.034091 | 0.090909 | 0.522727 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
72144ceaa16357aae6d835bca28de860a1008a0d | 219 | py | Python | alpyro_msgs/actionlib/twointsresult.py | rho2/alpyro_msgs | b5a680976c40c83df70d61bb2db1de32a1cde8d3 | [
"MIT"
] | 1 | 2020-12-13T13:07:10.000Z | 2020-12-13T13:07:10.000Z | alpyro_msgs/actionlib/twointsresult.py | rho2/alpyro_msgs | b5a680976c40c83df70d61bb2db1de32a1cde8d3 | [
"MIT"
] | null | null | null | alpyro_msgs/actionlib/twointsresult.py | rho2/alpyro_msgs | b5a680976c40c83df70d61bb2db1de32a1cde8d3 | [
"MIT"
] | null | null | null | from alpyro_msgs import RosMessage, int64
class TwoIntsResult(RosMessage):
__msg_typ__ = "actionlib/TwoIntsResult"
__msg_def__ = "aW50NjQgc3VtCgo="
__md5_sum__ = "b88405221c77b1878a3cbbfff53428d7"
sum: int64
| 21.9 | 50 | 0.794521 | 21 | 219 | 7.52381 | 0.761905 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.152632 | 0.13242 | 219 | 9 | 51 | 24.333333 | 0.678947 | 0 | 0 | 0 | 0 | 0 | 0.324201 | 0.251142 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.166667 | 0 | 1 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
7220065ac346431b46b0d884451d30c8c364af13 | 1,197 | py | Python | tests/py_tests/test_faint/test_color.py | lukas-ke/faint-graphics-editor | 33eb9e6a3f2216fb2cf6ef9709a14f3d20b78fbf | [
"Apache-2.0"
] | 10 | 2016-12-28T22:06:31.000Z | 2021-05-24T13:42:30.000Z | tests/py_tests/test_faint/test_color.py | lukas-ke/faint-graphics-editor | 33eb9e6a3f2216fb2cf6ef9709a14f3d20b78fbf | [
"Apache-2.0"
] | 4 | 2015-10-09T23:55:10.000Z | 2020-04-04T08:09:22.000Z | tests/py_tests/test_faint/test_color.py | lukas-ke/faint-graphics-editor | 33eb9e6a3f2216fb2cf6ef9709a14f3d20b78fbf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import unittest
import os
from faint import Color
class TestColor(unittest.TestCase):
"""Tests the faint.Color class"""
def test_color(self):
# Default construction
self.assertEqual(Color(), (0,0,0,255))
self.assertNotEqual(Color(), (0,1,0,255))
# Comparison
self.assertEqual(Color(1,2,3), Color(1,2,3))
self.assertEqual(Color(1,2,3), Color(1,2,3,255))
# Indexing
self.assertEqual(Color(0,1,2,3)[0], 0)
self.assertEqual(Color(0,1,2,3)[1], 1)
self.assertEqual(Color(0,1,2,3)[2], 2)
self.assertEqual(Color(0,1,2,3)[3], 3)
# Slicing
self.assertEqual(Color(0,1,2,3)[0:0], ())
self.assertEqual(Color(0,1,2,3)[0:1], (0,))
self.assertEqual(Color(0,1,2,3)[0:2], (0,1))
self.assertEqual(Color(0,1,2,3)[:], (0,1,2,3))
self.assertEqual(Color(0,1,2,3)[:-1], (0,1,2))
# Attributes
self.assertEqual(Color(0,1,2,3).r, 0)
self.assertEqual(Color(0,1,2,3).g, 1)
self.assertEqual(Color(0,1,2,3).b, 2)
self.assertEqual(Color(0,1,2,3).a, 3)
| 30.692308 | 57 | 0.548872 | 193 | 1,197 | 3.398964 | 0.196891 | 0.057927 | 0.082317 | 0.448171 | 0.60061 | 0.60061 | 0.597561 | 0.560976 | 0.329268 | 0.246951 | 0 | 0.122358 | 0.248956 | 1,197 | 38 | 58 | 31.5 | 0.607341 | 0.10944 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.772727 | 1 | 0.045455 | false | 0 | 0.136364 | 0 | 0.227273 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
72271323aa203721f64fa218fa1d431b444399d1 | 2,885 | py | Python | Trabalho02/Scripts/multiTest.sikuli/multiTest.py | Mazurco066/FATEC_SOFTWARE_TESTING | 45f2797484b3fc3be85d8bf68fd90873192b7354 | [
"MIT"
] | null | null | null | Trabalho02/Scripts/multiTest.sikuli/multiTest.py | Mazurco066/FATEC_SOFTWARE_TESTING | 45f2797484b3fc3be85d8bf68fd90873192b7354 | [
"MIT"
] | null | null | null | Trabalho02/Scripts/multiTest.sikuli/multiTest.py | Mazurco066/FATEC_SOFTWARE_TESTING | 45f2797484b3fc3be85d8bf68fd90873192b7354 | [
"MIT"
] | null | null | null | #Iniciando o navegador e acessando a página de login que se deseja testar
click("1509147510293.png");
type("Google Chrome");
type(Key.ENTER);
wait("1509147713937.png");
click("1509147762955.png");
paste("http://localhost/ChuvaInc/ChuWar/");
type(Key.ENTER);
wait("1509148189422.png");
#Criando Menu de Seleção de Testes
opcoes = ('1', '2');
escolha = select("Escolha 1 para teste de Login ou 2 para teste de Registro: ", options = opcoes);
if escolha == opcoes[0]:
#Página Carregada - Testando para campos vazios
click("1509148329279.png");
wait("1509148516450.png");
#Testando para entrada somente de usuário
click("1509148792209.png");
type("Teste01");
click("1509148329279.png");
wait("1509148516450.png");
#Testando para usuário correto e senha errada
click("1509148792209.png");
type("Teste01");
type(Key.TAB);
type("senhaerrada");
click("1509148329279.png");
wait("1509150616345.png");
#Testando com usuário correto e senha correta
click("1509148792209.png");
type("Teste01");
type(Key.TAB);
type("123456789");
click("1509148329279.png");
wait("1509150691340.png");
click("1509150702770.png");
popup("Teste de Login Concluido com Sucesso!");
else:
#Página Carregada - Testando com Campos Vazios
click("1509151729549.png");
click("1509151929229.png");
wait("1509151945935.png");
#Testando com Entrada somente de Username
click("1509152202418.png");
type("Sikuli01");
click("1509151929229.png");
wait("1509151945935.png");
#Testando com entrada somente de Username e Nome
click("1509152202418.png");
type("Sikuli01");
type(Key.TAB);
type("Sikuli");
click("1509151929229.png");
wait("1509151945935.png");
#Testando somente com entrada de Nome
click("1509152448748.png");
type("Sikuli");
click("1509151929229.png");
wait("1509151945935.png");
#Testando somente com entrada de Senha
click("1509152553548.png");
type("123456789");
click("1509151929229.png");
wait("1509151945935.png");
#Testando com entrada de Nome e Senha
click("1509152448748.png");
type("Sikuli");
type(Key.TAB);
type("123456789");
click("1509151929229.png");
wait("1509151945935.png");
#Testando com entrada de Usuario, Nome e Senha Muito Curta
click("1509152202418.png");
type("Sikuli01");
type(Key.TAB);
type("Sikuli");
type(Key.TAB);
type("1234567");
click("1509151929229.png");
wait("1509152734618.png");
#Testando com Usuário, Nome e Senha Corretamente
click("1509152202418.png");
type("Sikuli01");
type(Key.TAB);
type("Sikuli");
type(Key.TAB);
type("123456789");
click("1509151929229.png");
wait("1509152792694.png");
popup("Teste de Registro Concluido com Sucesso!");
| 27.216981 | 98 | 0.656153 | 333 | 2,885 | 5.684685 | 0.267267 | 0.044374 | 0.042261 | 0.059165 | 0.531432 | 0.474908 | 0.467512 | 0.467512 | 0.411516 | 0.362916 | 0 | 0.249464 | 0.191334 | 2,885 | 106 | 99 | 27.216981 | 0.561937 | 0.216291 | 0 | 0.723684 | 0 | 0 | 0.445285 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
722d396cbb12da31f805514e067723f40a0e823e | 290 | py | Python | python_basic/ex_ndarray.py | futuremax/EveryBodyTensorFlow | e45437c1ff3c6b061069b615a9e5349c1b6f8f8e | [
"Unlicense"
] | 109 | 2017-10-28T10:57:40.000Z | 2022-01-08T09:19:32.000Z | python_basic/ex_ndarray.py | pskdev/EveryBodyTensorFlow | 5166a366fca850a72de66e5ac48c421d4bb766f4 | [
"Unlicense"
] | 1 | 2018-01-15T07:12:11.000Z | 2018-01-15T07:12:11.000Z | python_basic/ex_ndarray.py | pskdev/EveryBodyTensorFlow | 5166a366fca850a72de66e5ac48c421d4bb766f4 | [
"Unlicense"
] | 88 | 2017-10-28T12:51:29.000Z | 2020-09-06T13:24:45.000Z | import numpy as np
print '# [Numpy example1] ----------'
templist = [1,2,3,4,5,6]
templist = range(1,7)
np_templist = np.array(templist)
print np_templist
print '# Numpy example 2] --------'
np_tepmlist_int = np.array(templist,dtype=np.int8)
print '# Numpy example 3] -------'
| 12.608696 | 50 | 0.624138 | 43 | 290 | 4.116279 | 0.488372 | 0.169492 | 0.169492 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.049587 | 0.165517 | 290 | 22 | 51 | 13.181818 | 0.681818 | 0 | 0 | 0 | 0 | 0 | 0.288732 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | null | 0 | 0.111111 | null | null | 0.444444 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 2 |
723e9db2a1d3052d2b30541533c29c60a12ff551 | 59 | py | Python | II/q4.py | skellykiernan/pylearn | b3576a087c8005e57b8415d63dc75d6975b3480f | [
"BSD-3-Clause"
] | null | null | null | II/q4.py | skellykiernan/pylearn | b3576a087c8005e57b8415d63dc75d6975b3480f | [
"BSD-3-Clause"
] | null | null | null | II/q4.py | skellykiernan/pylearn | b3576a087c8005e57b8415d63dc75d6975b3480f | [
"BSD-3-Clause"
] | null | null | null | X = 'spam'
Y = 'eggs'
# will swap
X, Y = Y, X
print((X, Y)) | 11.8 | 13 | 0.491525 | 13 | 59 | 2.230769 | 0.538462 | 0.137931 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.254237 | 59 | 5 | 13 | 11.8 | 0.659091 | 0.152542 | 0 | 0 | 0 | 0 | 0.163265 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0.25 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
725196648cf308489f7e351afa5d4715cc4b9f59 | 374 | py | Python | supervisr/mail/forms/addresses.py | BeryJu/supervisr | 2305b1e27abb0bfe9fcee93b79e012c62cba712e | [
"MIT"
] | 1 | 2020-01-12T21:33:03.000Z | 2020-01-12T21:33:03.000Z | supervisr/mail/forms/addresses.py | BeryJu/supervisr | 2305b1e27abb0bfe9fcee93b79e012c62cba712e | [
"MIT"
] | null | null | null | supervisr/mail/forms/addresses.py | BeryJu/supervisr | 2305b1e27abb0bfe9fcee93b79e012c62cba712e | [
"MIT"
] | null | null | null | """supervisr mail Address forms"""
from django.forms import ModelForm
from django.utils.translation import ugettext_lazy as _
from supervisr.mail.models import Address
class AddressForm(ModelForm):
"""Address Form"""
title = _('General Information')
class Meta:
model = Address
fields = ['mail_address', 'enabled', 'domains', 'providers']
| 20.777778 | 68 | 0.697861 | 41 | 374 | 6.268293 | 0.634146 | 0.101167 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.192513 | 374 | 17 | 69 | 22 | 0.850993 | 0.109626 | 0 | 0 | 0 | 0 | 0.167702 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.375 | 0 | 0.75 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
7253b73a5cda4cd5617a87585e0fc53fc67de5fe | 326 | py | Python | scripts/field/Curbrock_Summon2.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 54 | 2019-04-16T23:24:48.000Z | 2021-12-18T11:41:50.000Z | scripts/field/Curbrock_Summon2.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 3 | 2019-05-19T15:19:41.000Z | 2020-04-27T16:29:16.000Z | scripts/field/Curbrock_Summon2.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 49 | 2020-11-25T23:29:16.000Z | 2022-03-26T16:20:24.000Z | # Curbrock Summon 3
CURBROCK3 = 9400931 # MOD ID
CURBROCKS_ESCAPE_ROUTE_VER3 = 600050050 # MAP ID
sm.spawnMob(CURBROCK3, 320, -208, False)
sm.createClock(1800)
sm.addEvent(sm.invokeAfterDelay(1800000, "warp", CURBROCKS_ESCAPE_ROUTE_VER3, 0))
sm.waitForMobDeath(CURBROCK3)
sm.warp(CURBROCKS_ESCAPE_ROUTE_VER3)
sm.stopEvents() | 29.636364 | 81 | 0.803681 | 45 | 326 | 5.622222 | 0.6 | 0.177866 | 0.237154 | 0.284585 | 0.221344 | 0 | 0 | 0 | 0 | 0 | 0 | 0.138047 | 0.088957 | 326 | 11 | 82 | 29.636364 | 0.713805 | 0.095092 | 0 | 0 | 0 | 0 | 0.013699 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
a0c777ced534a7c57673ba60c0ed51c4fe05444f | 1,086 | py | Python | gol/mtAntenna.py | MrTrustworthy/game_of_life | 183ddf40e501094a7e0024dd707a197a40124141 | [
"MIT"
] | null | null | null | gol/mtAntenna.py | MrTrustworthy/game_of_life | 183ddf40e501094a7e0024dd707a197a40124141 | [
"MIT"
] | null | null | null | gol/mtAntenna.py | MrTrustworthy/game_of_life | 183ddf40e501094a7e0024dd707a197a40124141 | [
"MIT"
] | null | null | null | __author__ = 'MrTrustworthy'
import inspect
class Antenna:
def __init__(self):
self.listeners = {}
def add_listener(self, channel, callback):
if len(inspect.signature(callback).parameters) == 0:
raise TypeError("Callback Function needs at least 1 parameter")
if channel not in self.listeners.keys():
self.listeners[channel] = []
self.listeners[channel].append(callback)
def remove_listener(self, channel, callback):
if channel in self.listeners.keys():
if callback in self.listeners[channel]:
self.listeners[channel].remove(callback)
if len(self.listeners[channel]) == 0:
del self.listeners[channel]
def dispatch_message(self, channel, info=None, fail_when_empty=False):
if channel not in self.listeners.keys():
if fail_when_empty:
raise KeyError("No listener on this channel")
else:
return
for callback in self.listeners[channel]:
callback(info)
| 29.351351 | 75 | 0.611418 | 120 | 1,086 | 5.408333 | 0.4 | 0.220339 | 0.215716 | 0.087827 | 0.405239 | 0.218798 | 0.095532 | 0 | 0 | 0 | 0 | 0.003916 | 0.294659 | 1,086 | 36 | 76 | 30.166667 | 0.843342 | 0 | 0 | 0.08 | 0 | 0 | 0.077348 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.16 | false | 0 | 0.04 | 0 | 0.28 | 0 | 0 | 0 | 0 | null | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
a0d7c67687bd4da00c4c6974ff420405bf046880 | 1,673 | py | Python | openibanlib/openiban.py | nathanIL/openiban | cb12ac2914b60d0e77785809ead0e2cf6311220f | [
"MIT"
] | 3 | 2016-03-31T17:56:01.000Z | 2021-06-24T15:44:43.000Z | openibanlib/openiban.py | nathanIL/openiban | cb12ac2914b60d0e77785809ead0e2cf6311220f | [
"MIT"
] | 1 | 2018-03-22T16:45:17.000Z | 2018-03-22T16:45:17.000Z | openibanlib/openiban.py | nathanIL/openiban | cb12ac2914b60d0e77785809ead0e2cf6311220f | [
"MIT"
] | null | null | null | '''
Created on Apr 30, 2015
@author: nabu
'''
from openibanlib.exceptions import IBANFormatValidationException
import re
class IBAN(object):
"""
A class for representing an IBAN
"""
def __init__(self,v):
"""
We Perform a non-costly offline IBAN validation here.
A more serious validation is performed by the required service provider
"""
if (self.__class__.format_validate(v)):
self._iban = v
else:
raise IBANFormatValidationException("Invalid IBAN format provided: %s" % v)
def __str__(self):
"""
We are simply wrapping a str, so we delegate to str's __str__()
"""
return str(self._iban)
def __hash__(self):
"""
We are simply wrapping a str, so we delegate to str's __hash__()
"""
return hash(self._iban)
def __eq__(self,other):
return self.__hash__() == other.__hash__()
@staticmethod
def format_validate(ibn):
"""
Basic IBAN validation based on: http://en.wikipedia.org/wiki/International_Bank_Account_Number#Validating_the_IBAN
this is before we actually send the IBAN over the network wire.
Skipping the length part since we dont want to hardcode country specific lengths (its somewhat ugly).
"""
def converter(c):
if re.match("[A-Z]", c, re.IGNORECASE):
return ord(c) - 55
else:
return c
integered = int(''.join( [ str(v) for v in map( converter , ibn[4:] + ibn[0:4]) ] ))
return integered % 97 == 1
| 29.875 | 126 | 0.579199 | 201 | 1,673 | 4.59204 | 0.542289 | 0.022752 | 0.019502 | 0.032503 | 0.097508 | 0.097508 | 0.097508 | 0.097508 | 0.097508 | 0.097508 | 0 | 0.012411 | 0.325762 | 1,673 | 55 | 127 | 30.418182 | 0.805851 | 0.362821 | 0 | 0.086957 | 0 | 0 | 0.041203 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.26087 | false | 0 | 0.086957 | 0.043478 | 0.652174 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
a0e2af2e6446e022f3d972a5d470da1a6a6cc6aa | 1,376 | py | Python | didcomm/common/resolvers.py | DenisRybas/didcomm-python | d7e83428f086d1080aaa8a9643495ca442ef9722 | [
"Apache-2.0"
] | null | null | null | didcomm/common/resolvers.py | DenisRybas/didcomm-python | d7e83428f086d1080aaa8a9643495ca442ef9722 | [
"Apache-2.0"
] | null | null | null | didcomm/common/resolvers.py | DenisRybas/didcomm-python | d7e83428f086d1080aaa8a9643495ca442ef9722 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from didcomm.did_doc.did_resolver import DIDResolver
from didcomm.secrets.secrets_resolver import SecretsResolver
# TODO: Decide if we want to provide a possiblity to register default resolvers,
# or it's better to always pass ResolversConfig explicitly to every pack/sign/unpack/etc. methods.
def register_default_did_resolver(did_resolver: DIDResolver):
"""
Registers a DID Resolver that can be used in all pack/unpack operations by default.
:param did_resolver: a default DID resolver to be registered.
"""
pass
def register_default_secrets_resolver(secrets_resolver: SecretsResolver):
"""
Registers a Secrets Resolver that can be used in all pack/unpack operations by default.
:param secrets_resolver: a default secrets resolver to be registered.
"""
pass
@dataclass(frozen=True)
class ResolversConfig:
"""
Resolvers configuration.
Attributes:
secrets_resolver (SecretsResolver): an optional secrets resolver that can override a default secrets resolver
registered by 'register_default_secrets_resolver'
did_resolver (DIDResolver): an optional DID Doc resolver that can override a default DID Doc resolver
registered by 'register_default_did_resolver'
"""
secrets_resolver: SecretsResolver = None
did_resolver: DIDResolver = None
| 32.761905 | 117 | 0.763081 | 174 | 1,376 | 5.902299 | 0.333333 | 0.160662 | 0.058423 | 0.050633 | 0.296008 | 0.177215 | 0.116845 | 0.116845 | 0.116845 | 0.116845 | 0 | 0 | 0.18532 | 1,376 | 41 | 118 | 33.560976 | 0.916146 | 0.614099 | 0 | 0.181818 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02439 | 0 | 1 | 0.181818 | false | 0.181818 | 0.272727 | 0 | 0.727273 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 2 |
9d103844da7548e30212794ddd4581f9a8ca8eeb | 604 | py | Python | tests/models.py | adamchainz/django-testdata | 19e118ecfba7e25dd4b1e82dac5751baf0b195f8 | [
"MIT"
] | 24 | 2018-11-23T10:32:28.000Z | 2021-06-04T07:44:46.000Z | tests/models.py | adamchainz/django-testdata | 19e118ecfba7e25dd4b1e82dac5751baf0b195f8 | [
"MIT"
] | 8 | 2020-03-03T18:40:14.000Z | 2021-09-18T14:44:55.000Z | tests/models.py | adamchainz/django-testdata | 19e118ecfba7e25dd4b1e82dac5751baf0b195f8 | [
"MIT"
] | 2 | 2020-03-03T18:37:22.000Z | 2020-10-01T16:26:07.000Z | from __future__ import unicode_literals
from django.db import models
try:
from django.utils.encoding import python_2_unicode_compatible
except ImportError:
def python_2_unicode_compatible(cls):
return cls
@python_2_unicode_compatible
class Author(models.Model):
name = models.CharField(max_length=100)
def __str__(self):
return self.name
@python_2_unicode_compatible
class Book(models.Model):
title = models.CharField(max_length=100)
author = models.ForeignKey(Author, models.CASCADE, related_name='books')
def __str__(self):
return self.title
| 22.37037 | 76 | 0.751656 | 79 | 604 | 5.392405 | 0.443038 | 0.065728 | 0.131455 | 0.225352 | 0.356808 | 0 | 0 | 0 | 0 | 0 | 0 | 0.02 | 0.172185 | 604 | 26 | 77 | 23.230769 | 0.832 | 0 | 0 | 0.222222 | 0 | 0 | 0.008278 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.222222 | 0.166667 | 0.833333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 2 |
9d29e01d99d973333f34fcbedf6247e4f3301218 | 1,188 | py | Python | homework/loops_lists_hw.py | mcorley-gba/IntroCS21-22 | a823e17f2cb618be0e67468cb15f48873ae85152 | [
"MIT"
] | null | null | null | homework/loops_lists_hw.py | mcorley-gba/IntroCS21-22 | a823e17f2cb618be0e67468cb15f48873ae85152 | [
"MIT"
] | null | null | null | homework/loops_lists_hw.py | mcorley-gba/IntroCS21-22 | a823e17f2cb618be0e67468cb15f48873ae85152 | [
"MIT"
] | null | null | null | #Problem 1:
# 1.) Think of at least three kinds of your favorite pizza. Store these pizza names in a list.
# Use a for loop to print the name of each pizza
# 2.) Make a new for loop that will print a sentence using the name of the pizza,
# rather than just printing the name only. For each pizza, you should have one
# line of output containing a simple statement.
# Ex: 'I like pepperoni pizza.'
# 3.) Add a line outside of the for loop for part 2 which states how much you like pizza.
# The output should now have one additional sentence.
# Ex: 'Pizza is my favorite food.'
#Write your code belo:
#Problem 2:
# 1.) Use a for loop to print the numbers from one to twenty.
# 2.) Use the range() function to make a list of odd numbers
# from one to one-million. Use a for loop to print the numbers.
# (Hint: To get only odd numbers, you will have to use the third
# argument of the range() function.)
# 3.) Make an empty list called 'cubes'. Use a for loop to append
# the first 10 cubes to this list in order.
# (Hint: You will have to use the ** operator to get the cubes.)
#Write your code below:
| 37.125 | 96 | 0.672559 | 207 | 1,188 | 3.859903 | 0.425121 | 0.052566 | 0.035044 | 0.055069 | 0.1602 | 0.14393 | 0.09637 | 0.070088 | 0 | 0 | 0 | 0.012571 | 0.263468 | 1,188 | 31 | 97 | 38.322581 | 0.900571 | 0.956229 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
9d3ec5b220f0d129f2f485d2f798ef5e56b6f8f0 | 785 | py | Python | signage/models.py | CodedInternet/django-signage | a0ce53393e13367f91969da434afcadedaa7760e | [
"MIT"
] | null | null | null | signage/models.py | CodedInternet/django-signage | a0ce53393e13367f91969da434afcadedaa7760e | [
"MIT"
] | null | null | null | signage/models.py | CodedInternet/django-signage | a0ce53393e13367f91969da434afcadedaa7760e | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import Group
from django.conf import settings
# Create your models here.
class Content(models.Model):
content = models.CharField(max_length=140)
content_type = models.CharField(max_length=6)
duration = models.IntegerField(min_value=1)
start = models.DateTimeField()
end = models.DateTimeField()
rank = models.IntegerField(min_value=1)
feed = models.ForeignKey(Feed)
user = models.ForeignKey(settings.AUTH_USER_MODEL)
class Feed(models.Model):
feedname = models.CharField(max_length=80)
group = models.ForeignKey(Group)
class Screen(models.Model):
screenname = models.CharField(max_length=80)
hash = models.CharField(max_length=32)
feeds = models.ManyToManyField(Feed) | 31.4 | 54 | 0.749045 | 101 | 785 | 5.722772 | 0.415842 | 0.129758 | 0.155709 | 0.207612 | 0.183391 | 0 | 0 | 0 | 0 | 0 | 0 | 0.017991 | 0.150318 | 785 | 25 | 55 | 31.4 | 0.848576 | 0.030573 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | false | 0 | 0.157895 | 0 | 1 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 2 |
9d48cfe0841fccd7468c4a6695184aa2d9350807 | 1,759 | py | Python | pypy/module/math/_genmath.py | camillobruni/pygirl | ddbd442d53061d6ff4af831c1eab153bcc771b5a | [
"MIT"
] | 12 | 2016-01-06T07:10:28.000Z | 2021-05-13T23:02:02.000Z | pypy/module/math/_genmath.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | pypy/module/math/_genmath.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | 2 | 2016-07-29T07:09:50.000Z | 2016-10-16T08:50:26.000Z | # ONESHOT SCRIPT (probably can go away soon)
# to generate the mixed module 'math' (see same directory)
import py
import math
import re
import sys
rex_arg = re.compile(".*\((.*)\).*")
if __name__ == '__main__':
print py.code.Source("""
import math
from pypy.interpreter.gateway import ObjSpace
""")
names = []
for name, func in math.__dict__.items():
if not callable(func):
continue
sig = func.__doc__.split('\n')[0].strip()
sig = sig.split('->')[0].strip()
m = rex_arg.match(sig)
assert m
args = m.group(1)
args = ", ".join(args.split(','))
sig = sig.replace('(', '(space,')
sig = ", ".join(sig.split(','))
argc = len(args.split(','))
unwrap_spec = ['ObjSpace']
unwrap_spec += ['float'] * argc
unwrap_spec = ", ".join(unwrap_spec)
doc = func.__doc__.replace('\n', '\n ')
print py.code.Source('''
def %(sig)s:
"""%(doc)s
"""
return space.wrap(math.%(name)s(%(args)s))
%(name)s.unwrap_spec = [%(unwrap_spec)s]
''' % locals())
names.append(name)
print >>sys.stderr, py.code.Source("""
# Package initialisation
from pypy.interpreter.mixedmodule import MixedModule
class Module(MixedModule):
appleveldefs = {
}
interpleveldefs = {
""")
for name in names:
space = " " * (15-len(name))
print >>sys.stderr, (
" %(name)r%(space)s: 'interp_math.%(name)s'," % locals())
print >>sys.stderr, py.code.Source("""
}
""")
| 27.920635 | 75 | 0.486072 | 186 | 1,759 | 4.44086 | 0.424731 | 0.072639 | 0.058111 | 0.041162 | 0.062954 | 0.062954 | 0 | 0 | 0 | 0 | 0 | 0.004355 | 0.347356 | 1,759 | 62 | 76 | 28.370968 | 0.715157 | 0.056282 | 0 | 0.14 | 1 | 0 | 0.371377 | 0.066425 | 0 | 0 | 0 | 0 | 0.02 | 0 | null | null | 0 | 0.14 | null | null | 0.1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
9d50f5076af2622aec588490f7b84079fff9f0c3 | 1,577 | py | Python | facenet_train_by_tripletloss.py | Jerzha/rknn_facenet | a0ad253393fe08d83e3e6184951d2558d8496297 | [
"Apache-2.0"
] | 10 | 2019-05-23T02:58:59.000Z | 2021-09-24T10:36:27.000Z | facenet_train_by_tripletloss.py | Jerzha/rknn_facenet | a0ad253393fe08d83e3e6184951d2558d8496297 | [
"Apache-2.0"
] | null | null | null | facenet_train_by_tripletloss.py | Jerzha/rknn_facenet | a0ad253393fe08d83e3e6184951d2558d8496297 | [
"Apache-2.0"
] | 6 | 2019-04-30T13:12:17.000Z | 2021-05-10T02:25:57.000Z | import tensorflow as tf
import datasets.casia_webface as webface
import models.inception_resnet_v1 as facenet
BATCH_SIZE = 32
def triple_loss(y_true, y_pred, batch_size=BATCH_SIZE, alpha=0.2):
print('True Shape:' + str(y_true.get_shape()))
print('Pred Shape:' + str(y_pred.get_shape()))
anchor = y_pred[0:batch_size, :]
positive = y_pred[batch_size:batch_size+batch_size, :]
negative = y_pred[batch_size+batch_size:batch_size*3, :]
pos_dist = tf.reduce_sum(tf.square(tf.subtract(anchor, positive)), 1)
neg_dist = tf.reduce_sum(tf.square(tf.subtract(anchor, negative)), 1)
basic_loss = tf.add(tf.subtract(pos_dist, neg_dist), alpha)
loss = tf.reduce_mean(tf.maximum(basic_loss, 0.0), 0)
return loss
def train_from_folder():
tf.keras.backend.set_learning_phase(1) # 设置成训练模式(默认)
data_gen = webface.CASIAWebFaceSequence('/datasets/CASIA-WebFace_aligned', target_shape=[149, 149], batch_size=BATCH_SIZE, shuffle=True)
callbacks = [
tf.keras.callbacks.ModelCheckpoint(filepath='./checkpoints/facenet_rgb-{epoch:02d}.h5'),
tf.keras.callbacks.TensorBoard(log_dir='./logs')
]
model = facenet.InceptionResnetV1()
model.compile(optimizer=tf.keras.optimizers.SGD(),
loss=triple_loss,
metrics=[tf.keras.metrics.categorical_accuracy])
model.fit_generator(data_gen, epochs=20, max_queue_size=10, workers=8, callbacks=callbacks)
model.save_weights('./weights/facenet_rgb_weights.h5')
model.save('./facenet_rgb.h5')
if __name__ == '__main__':
# TODO
| 36.674419 | 140 | 0.710843 | 224 | 1,577 | 4.732143 | 0.4375 | 0.101887 | 0.079245 | 0.101887 | 0.15566 | 0.15566 | 0.133962 | 0.133962 | 0.073585 | 0 | 0 | 0.022489 | 0.15409 | 1,577 | 42 | 141 | 37.547619 | 0.772114 | 0.010146 | 0 | 0 | 0 | 0 | 0.099487 | 0.06611 | 0 | 0 | 0 | 0.02381 | 0 | 0 | null | null | 0 | 0.1 | null | null | 0.066667 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
9d55b93d27a04673878686228f540d7d264576be | 448 | py | Python | Paradigmas Python/aula09/exercicio2.py | Neto002/Estacio | 0c89cefb4d68a1054aab881099c6191cf8000392 | [
"MIT"
] | null | null | null | Paradigmas Python/aula09/exercicio2.py | Neto002/Estacio | 0c89cefb4d68a1054aab881099c6191cf8000392 | [
"MIT"
] | null | null | null | Paradigmas Python/aula09/exercicio2.py | Neto002/Estacio | 0c89cefb4d68a1054aab881099c6191cf8000392 | [
"MIT"
] | null | null | null | '''class Pessoa(object):
def __init__(self, nome, idade, peso):
self.nome = nome
self.idade = idade
self.peso = peso
def andar(self):
print('anda')
pessoa1 = Pessoa("Juliana", 23, 75)
pessoa2 = Pessoa("Carlos", 39, 72)
print(pessoa1.nome)
pessoa1.andar()
def fatorial(n):
if n == 0:
return 0
if n == 1:
return 1
if n > 1:
return fatorial(n-1) * n
print(fatorial(5))''' | 19.478261 | 42 | 0.553571 | 62 | 448 | 3.935484 | 0.435484 | 0.036885 | 0.032787 | 0.081967 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.060317 | 0.296875 | 448 | 23 | 43 | 19.478261 | 0.714286 | 0.986607 | 0 | null | 0 | null | 0 | 0 | null | 0 | 0 | 0 | null | 1 | null | true | 0 | 0 | null | null | null | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
9d55cc4b2f7c17b4f00a21ea6de666e48dca2c77 | 419 | py | Python | mowgli_etl/pipeline/wdc/wdc_product_type_classifier.py | tetherless-world/mowgli | 28c19eba41e03e053ae4addff56a313d926e18d7 | [
"MIT"
] | 4 | 2021-01-15T15:36:23.000Z | 2021-09-01T06:52:05.000Z | mowgli_etl/pipeline/wdc/wdc_product_type_classifier.py | tetherless-world/mowgli | 28c19eba41e03e053ae4addff56a313d926e18d7 | [
"MIT"
] | 63 | 2020-05-04T13:48:04.000Z | 2020-06-06T02:32:58.000Z | mowgli_etl/pipeline/wdc/wdc_product_type_classifier.py | tetherless-world/mowgli-etl | 28c19eba41e03e053ae4addff56a313d926e18d7 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from mowgli_etl.pipeline.wdc.wdc_product_type import WdcProductType
from mowgli_etl.pipeline.wdc.wdc_offers_corpus_entry import WdcOffersCorpusEntry
class WdcProductTypeClassifier(ABC):
@abstractmethod
def classify(self, *, entry: WdcOffersCorpusEntry) -> WdcProductType:
"""
Parse title/listing/other to pull ProductType with confidence value
"""
| 32.230769 | 80 | 0.770883 | 46 | 419 | 6.869565 | 0.652174 | 0.107595 | 0.082278 | 0.132911 | 0.170886 | 0.170886 | 0 | 0 | 0 | 0 | 0 | 0 | 0.162291 | 419 | 12 | 81 | 34.916667 | 0.900285 | 0.159905 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0.166667 | false | 0 | 0.5 | 0 | 0.833333 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 2 |
9d574e8e0d03c526ffb840a45676fb0cf3b90e07 | 326 | gyp | Python | binding.gyp | KaguraGateway/node-audio-volume-mixer | fbd08e4bd55e751bc88858acda3dea30989f2d63 | [
"MIT"
] | null | null | null | binding.gyp | KaguraGateway/node-audio-volume-mixer | fbd08e4bd55e751bc88858acda3dea30989f2d63 | [
"MIT"
] | null | null | null | binding.gyp | KaguraGateway/node-audio-volume-mixer | fbd08e4bd55e751bc88858acda3dea30989f2d63 | [
"MIT"
] | null | null | null | {
"targets": [
{
"target_name": "addon",
"sources": ["./src/cpp/nodeBridge.cpp", "./src/cpp/os/windows.cpp"],
"include_dirs": [
"<!@(node -p \"require('node-addon-api').include\")"
],
'defines': [ 'NAPI_CPP_EXCEPTIONS' ]
}
]
} | 27.166667 | 80 | 0.417178 | 27 | 326 | 4.888889 | 0.703704 | 0.090909 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.371166 | 326 | 12 | 81 | 27.166667 | 0.643902 | 0 | 0 | 0 | 0 | 0 | 0.440367 | 0.146789 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | true | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | null | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.