id int64 1 6.07M | name stringlengths 1 295 | code stringlengths 12 426k | language stringclasses 1
value | source_file stringlengths 5 202 | start_line int64 1 158k | end_line int64 1 158k | repo dict |
|---|---|---|---|---|---|---|---|
6,101 | __eq__ | def __eq__(self, other):
return (
self is other or (
isinstance(other, ExecutionResult) and
self.data == other.data and
self.errors == other.errors and
self.invalid == other.invalid
)
) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/base.py | 117 | 125 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,102 | get_operation_root_type | def get_operation_root_type(schema, operation):
op = operation.operation
if op == 'query':
return schema.get_query_type()
elif op == 'mutation':
mutation_type = schema.get_mutation_type()
if not mutation_type:
raise GraphQLError(
'Schema is not configure... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/base.py | 128 | 158 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,103 | collect_fields | def collect_fields(ctx, runtime_type, selection_set, fields, prev_fragment_names):
"""
Given a selectionSet, adds all of the fields in that selection to
the passed in map of fields, and returns it at the end.
collect_fields requires the "runtime type" of an object. For a field which
returns and Int... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/base.py | 161 | 204 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,104 | should_include_node | def should_include_node(ctx, directives):
"""Determines if a field should be included based on the @include and
@skip directives, where @skip has higher precidence than @include."""
# TODO: Refactor based on latest code
if directives:
skip_ast = None
for directive in directives:
... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/base.py | 207 | 245 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,105 | does_fragment_condition_match | def does_fragment_condition_match(ctx, fragment, type_):
type_condition_ast = fragment.type_condition
if not type_condition_ast:
return True
conditional_type = type_from_ast(ctx.schema, type_condition_ast)
if conditional_type.is_same_type(type_):
return True
if isinstance(condition... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/base.py | 248 | 260 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,106 | get_field_entry_key | def get_field_entry_key(node):
"""Implements the logic to compute the key of a given field's entry"""
if node.alias:
return node.alias.value
return node.name.value | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/base.py | 263 | 267 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,107 | __init__ | def __init__(self, field_name, field_asts, return_type, parent_type,
schema, fragments, root_value, operation, variable_values):
self.field_name = field_name
self.field_asts = field_asts
self.return_type = return_type
self.parent_type = parent_type
self.schema = ... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/base.py | 274 | 284 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,108 | default_resolve_fn | def default_resolve_fn(source, args, context, info):
"""If a resolve function is not given, then a default resolve behavior is used which takes the property of the source object
of the same name as the field and returns it as the result, or if it's a function, returns the result of calling that function."""
... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/base.py | 287 | 294 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,109 | get_field_def | def get_field_def(schema, parent_type, field_name):
"""This method looks up the field on the given type defintion.
It has special casing for the two introspection fields, __schema
and __typename. __typename is special because it can always be
queried as a field, even in situations where no other fields
... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/base.py | 297 | 311 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,110 | __init__ | def __init__(self, *middlewares, **kwargs):
self.middlewares = middlewares
self.wrap_in_promise = kwargs.get('wrap_in_promise', True)
self._middleware_resolvers = list(get_middleware_resolvers(middlewares))
self._cached_resolvers = {} | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/middleware.py | 12 | 16 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,111 | get_field_resolver | def get_field_resolver(self, field_resolver):
if field_resolver not in self._cached_resolvers:
self._cached_resolvers[field_resolver] = middleware_chain(
field_resolver,
self._middleware_resolvers,
wrap_in_promise=self.wrap_in_promise,
)
... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/middleware.py | 18 | 26 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,112 | get_middleware_resolvers | def get_middleware_resolvers(middlewares):
for middleware in middlewares:
# If the middleware is a function instead of a class
if inspect.isfunction(middleware):
yield middleware
if not hasattr(middleware, MIDDLEWARE_RESOLVER_FUNCTION):
continue
yield getattr(... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/middleware.py | 32 | 39 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,113 | middleware_chain | def middleware_chain(func, middlewares, wrap_in_promise):
if not middlewares:
return func
if wrap_in_promise:
middlewares = chain((func, make_it_promise), middlewares)
else:
middlewares = chain((func,), middlewares)
last_func = None
for middleware in middlewares:
last... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/middleware.py | 42 | 53 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,114 | make_it_promise | def make_it_promise(next, *a, **b):
return Promise.resolve(next(*a, **b)) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/middleware.py | 56 | 57 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,115 | execute | def execute(schema, document_ast, root_value=None, context_value=None,
variable_values=None, operation_name=None, executor=None,
return_promise=False, middleware=None):
if use_experimental_executor:
return experimental_execute(
schema, document_ast, root_value, context_va... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 28 | 82 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,116 | executor | def executor(resolve, reject):
return resolve(execute_operation(context, context.operation, root_value)) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 66 | 67 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,117 | on_rejected | def on_rejected(error):
context.errors.append(error)
return None | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 69 | 71 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,118 | on_resolve | def on_resolve(data):
if not context.errors:
return ExecutionResult(data=data)
return ExecutionResult(data=data, errors=context.errors) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 73 | 76 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,119 | execute_operation | def execute_operation(exe_context, operation, root_value):
type = get_operation_root_type(exe_context.schema, operation)
fields = collect_fields(
exe_context,
type,
operation.selection_set,
DefaultOrderedDict(list),
set()
)
if operation.operation == 'mutation':
... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 85 | 98 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,120 | execute_fields_serially | def execute_fields_serially(exe_context, parent_type, source_value, fields):
def execute_field_callback(results, response_name):
field_asts = fields[response_name]
result = resolve_field(
exe_context,
parent_type,
source_value,
field_asts
)
... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 101 | 126 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,121 | execute_field_callback | def execute_field_callback(results, response_name):
field_asts = fields[response_name]
result = resolve_field(
exe_context,
parent_type,
source_value,
field_asts
)
if result is Undefined:
return results
if is_thenable(r... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 102 | 121 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,122 | collect_result | def collect_result(resolved_result):
results[response_name] = resolved_result
return results | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 114 | 116 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,123 | execute_field | def execute_field(prev_promise, response_name):
return prev_promise.then(lambda results: execute_field_callback(results, response_name)) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 123 | 124 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,124 | execute_fields | def execute_fields(exe_context, parent_type, source_value, fields):
contains_promise = False
final_results = OrderedDict()
for response_name, field_asts in fields.items():
result = resolve_field(exe_context, parent_type, source_value, field_asts)
if result is Undefined:
continu... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 129 | 146 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,125 | resolve_field | def resolve_field(exe_context, parent_type, source, field_asts):
field_ast = field_asts[0]
field_name = field_ast.name.value
field_def = get_field_def(exe_context.schema, parent_type, field_name)
if not field_def:
return Undefined
return_type = field_def.type
resolve_fn = field_def.res... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 149 | 195 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,126 | resolve_or_error | def resolve_or_error(resolve_fn, source, args, context, info, executor):
try:
return executor.execute(resolve_fn, source, args, context, info)
except Exception as e:
logger.exception("An error occurred while resolving field {}.{}".format(
info.parent_type.name, info.field_name
... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 198 | 206 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,127 | complete_value_catching_error | def complete_value_catching_error(exe_context, return_type, field_asts, info, result):
# If the field type is non-nullable, then it is resolved without any
# protection from errors.
if isinstance(return_type, GraphQLNonNull):
return complete_value(exe_context, return_type, field_asts, info, result)
... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 209 | 229 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,128 | handle_error | def handle_error(error):
exe_context.errors.append(error)
return None | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 220 | 222 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,129 | complete_value | def complete_value(exe_context, return_type, field_asts, info, result):
"""
Implements the instructions for completeValue as defined in the
"Field entries" section of the spec.
If the field type is Non-Null, then this recursively completes the value for the inner type. It throws a field
error if th... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 232 | 290 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,130 | complete_list_value | def complete_list_value(exe_context, return_type, field_asts, info, result):
"""
Complete a list value by completing each item in the list with the inner type
"""
assert isinstance(result, Iterable), \
('User Error: expected iterable, but did not find one ' +
'for field {}.{}.').format(... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 293 | 311 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,131 | complete_leaf_value | def complete_leaf_value(return_type, result):
"""
Complete a Scalar or Enum by serializing to a valid value, returning null if serialization is not possible.
"""
# serialize = getattr(return_type, 'serialize', None)
# assert serialize, 'Missing serialize method on type'
return return_type.seria... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 314 | 321 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,132 | complete_abstract_value | def complete_abstract_value(exe_context, return_type, field_asts, info, result):
"""
Complete an value of an abstract type by determining the runtime type of that value, then completing based
on that type.
"""
runtime_type = None
# Field type must be Object, Interface or Union and expect sub-se... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 324 | 360 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,133 | get_default_resolve_type_fn | def get_default_resolve_type_fn(value, context, info, abstract_type):
possible_types = info.schema.get_possible_types(abstract_type)
for type in possible_types:
if callable(type.is_type_of) and type.is_type_of(value, context, info):
return type | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 363 | 367 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,134 | complete_object_value | def complete_object_value(exe_context, return_type, field_asts, info, result):
"""
Complete an Object value by evaluating all sub-selections.
"""
if return_type.is_type_of and not return_type.is_type_of(result, exe_context.context_value, info):
raise GraphQLError(
u'Expected value of... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 370 | 382 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,135 | complete_nonnull_value | def complete_nonnull_value(exe_context, return_type, field_asts, info, result):
"""
Complete a NonNull value by completing the inner type
"""
completed = complete_value(
exe_context, return_type.of_type, field_asts, info, result
)
if completed is None:
raise GraphQLError(
... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executor.py | 385 | 398 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,136 | get_base_type | def get_base_type(type):
if isinstance(type, (GraphQLList, GraphQLNonNull)):
return get_base_type(type.of_type)
return type | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 18 | 21 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,137 | get_subfield_asts | def get_subfield_asts(context, return_type, field_asts):
subfield_asts = DefaultOrderedDict(list)
visited_fragment_names = set()
for field_ast in field_asts:
selection_set = field_ast.selection_set
if selection_set:
subfield_asts = collect_fields(
context, return_... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 24 | 34 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,138 | get_resolvers | def get_resolvers(context, type, field_asts):
from .resolver import field_resolver
subfield_asts = get_subfield_asts(context, type, field_asts)
for response_name, field_asts in subfield_asts.items():
field_ast = field_asts[0]
field_name = field_ast.name.value
field_def = get_field_d... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 37 | 80 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,139 | __init__ | def __init__(self, fn, args, context, info):
self.fn = fn
self.args = args
self.context = context
self.info = info | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 86 | 90 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,140 | execute | def execute(self, root):
return self.fn(root, self.args, self.context, self.info) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 92 | 93 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,141 | __init__ | def __init__(self, type, field_asts, context=None, info=None):
self.type = type
self.field_asts = field_asts
self.context = context
self.info = info | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 98 | 102 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,142 | partial_resolvers | def partial_resolvers(self):
return list(get_resolvers(
self.context,
self.type,
self.field_asts
)) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 105 | 110 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,143 | fragment_container | def fragment_container(self):
try:
fields = next(zip(*self.partial_resolvers))
except StopIteration:
fields = tuple()
class FragmentInstance(dict):
# def __init__(self):
# self.fields = fields
# _fields = ('c','b','a')
... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 113 | 130 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,144 | __iter__ | def __iter__(self):
return iter(fields) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 127 | 128 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,145 | have_type | def have_type(self, root):
return not self.type.is_type_of or self.type.is_type_of(root, self.context.context_value, self.info) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 132 | 133 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,146 | resolve | def resolve(self, root):
if root and not self.have_type(root):
raise GraphQLError(
u'Expected value of type "{}" but got: {}.'.format(self.type, type(root).__name__),
self.info.field_asts
)
contains_promise = False
final_results = self.fr... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 135 | 167 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,147 | resolve_serially | def resolve_serially(self, root):
def execute_field_callback(results, resolver):
response_name, field_resolver = resolver
result = field_resolver.execute(root)
if result is Undefined:
return results
if is_thenable(result):
def co... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 169 | 191 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,148 | execute_field_callback | def execute_field_callback(results, resolver):
response_name, field_resolver = resolver
result = field_resolver.execute(root)
if result is Undefined:
return results
if is_thenable(result):
def collect_result(resolved_result):
... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 170 | 186 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,149 | collect_result | def collect_result(resolved_result):
results[response_name] = resolved_result
return results | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 179 | 181 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,150 | execute_field | def execute_field(prev_promise, resolver):
return prev_promise.then(lambda results: execute_field_callback(results, resolver)) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 188 | 189 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,151 | __eq__ | def __eq__(self, other):
return isinstance(other, Fragment) and (
other.type == self.type and
other.field_asts == self.field_asts and
other.context == self.context and
other.info == self.info
) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 193 | 199 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,152 | __init__ | def __init__(self, abstract_type, field_asts, context=None, info=None):
self.abstract_type = abstract_type
self.field_asts = field_asts
self.context = context
self.info = info
self._fragments = {} | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 204 | 209 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,153 | possible_types | def possible_types(self):
return self.context.schema.get_possible_types(self.abstract_type) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 212 | 213 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,154 | possible_types_with_is_type_of | def possible_types_with_is_type_of(self):
return [
(type, type.is_type_of) for type in self.possible_types if callable(type.is_type_of)
] | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 216 | 219 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,155 | get_fragment | def get_fragment(self, type):
if isinstance(type, str):
type = self.context.schema.get_type(type)
if type not in self._fragments:
assert type in self.possible_types, (
'Runtime Object type "{}" is not a possible type for "{}".'
).format(type, self.abs... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 221 | 236 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,156 | resolve_type | def resolve_type(self, result):
return_type = self.abstract_type
context = self.context.context_value
if return_type.resolve_type:
return return_type.resolve_type(result, context, self.info)
for type, is_type_of in self.possible_types_with_is_type_of:
if is_type... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 238 | 247 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,157 | resolve | def resolve(self, root):
_type = self.resolve_type(root)
fragment = self.get_fragment(_type)
return fragment.resolve(root) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/fragment.py | 249 | 252 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,158 | normal_map | def normal_map(func, iter):
return list(map(func, iter)) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/utils.py | 5 | 6 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,159 | on_complete_resolver | def on_complete_resolver(on_error, __func, exe_context, info, __resolver, *args, **kwargs):
try:
result = __resolver(*args, **kwargs)
if isinstance(result, Exception):
return on_error(result)
# return Promise.resolve(result).then(__func).catch(on_error)
if is_thenable(res... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/resolver.py | 16 | 33 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,160 | on_resolve | def on_resolve(value):
if isinstance(value, Exception):
return on_error(value)
return value | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/resolver.py | 26 | 29 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,161 | complete_list_value | def complete_list_value(inner_resolver, exe_context, info, on_error, result):
if result is None:
return None
assert isinstance(result, Iterable), \
('User Error: expected iterable, but did not find one ' +
'for field {}.{}.').format(info.parent_type, info.field_name)
completed_res... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/resolver.py | 36 | 49 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,162 | complete_nonnull_value | def complete_nonnull_value(exe_context, info, result):
if result is None:
raise GraphQLError(
'Cannot return null for non-nullable field {}.{}.'.format(info.parent_type, info.field_name),
info.field_asts
)
return result | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/resolver.py | 52 | 58 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,163 | complete_leaf_value | def complete_leaf_value(serialize, result):
if result is None:
return None
return serialize(result) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/resolver.py | 61 | 64 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,164 | complete_object_value | def complete_object_value(fragment_resolve, exe_context, on_error, result):
if result is None:
return None
result = fragment_resolve(result)
if is_thenable(result):
return result.catch(on_error)
return result | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/resolver.py | 67 | 74 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,165 | field_resolver | def field_resolver(field, fragment=None, exe_context=None, info=None):
# resolver = exe_context.get_field_resolver(field.resolver or default_resolve_fn)
resolver = field.resolver or default_resolve_fn
if exe_context:
# We decorate the resolver with the middleware
resolver = exe_context.get_f... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/resolver.py | 77 | 84 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,166 | type_resolver | def type_resolver(return_type, resolver, fragment=None, exe_context=None, info=None, catch_error=False):
if isinstance(return_type, GraphQLNonNull):
return type_resolver_non_null(return_type, resolver, fragment, exe_context, info)
if isinstance(return_type, (GraphQLScalarType, GraphQLEnumType)):
... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/resolver.py | 87 | 105 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,167 | on_error | def on_error(exe_context, info, catch_error, e):
error = e
if not isinstance(e, (GraphQLLocatedError, GraphQLError)):
error = GraphQLLocatedError(info.field_asts, original_error=e)
if catch_error:
exe_context.errors.append(error)
executor.logger.exception("An error occurred while res... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/resolver.py | 108 | 119 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,168 | type_resolver_fragment | def type_resolver_fragment(return_type, resolver, fragment, exe_context, info, catch_error):
on_complete_type_error = partial(on_error, exe_context, info, catch_error)
complete_object_value_resolve = partial(
complete_object_value,
fragment.resolve,
exe_context,
on_complete_type_... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/resolver.py | 122 | 130 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,169 | type_resolver_non_null | def type_resolver_non_null(return_type, resolver, fragment, exe_context, info): # no catch_error
resolver = type_resolver(return_type.of_type, resolver, fragment, exe_context, info)
nonnull_complete = partial(complete_nonnull_value, exe_context, info)
on_resolve_error = partial(on_error, exe_context, info,... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/resolver.py | 133 | 137 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,170 | type_resolver_leaf | def type_resolver_leaf(return_type, resolver, exe_context, info, catch_error):
leaf_complete = partial(complete_leaf_value, return_type.serialize)
on_resolve_error = partial(on_error, exe_context, info, catch_error)
return partial(on_complete_resolver, on_resolve_error, leaf_complete, exe_context, info, res... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/resolver.py | 140 | 143 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,171 | type_resolver_list | def type_resolver_list(return_type, resolver, fragment, exe_context, info, catch_error):
item_type = return_type.of_type
inner_resolver = type_resolver(item_type, lambda item: item, fragment, exe_context, info, catch_error=True)
on_resolve_error = partial(on_error, exe_context, info, catch_error)
list_c... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/resolver.py | 146 | 151 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,172 | execute | def execute(schema, document_ast, root_value=None, context_value=None,
variable_values=None, operation_name=None, executor=None,
return_promise=False, middleware=None):
assert schema, 'Must provide schema'
assert isinstance(schema, GraphQLSchema), (
'Schema must be an instance of... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/executor.py | 10 | 56 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,173 | executor | def executor(resolve, reject):
return resolve(execute_operation(context, context.operation, root_value)) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/executor.py | 40 | 41 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,174 | on_rejected | def on_rejected(error):
context.errors.append(error)
return None | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/executor.py | 43 | 45 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,175 | on_resolve | def on_resolve(data):
if not context.errors:
return ExecutionResult(data=data)
return ExecutionResult(data=data, errors=context.errors) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/executor.py | 47 | 50 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,176 | execute_operation | def execute_operation(exe_context, operation, root_value):
type = get_operation_root_type(exe_context.schema, operation)
execute_serially = operation.operation == 'mutation'
fragment = Fragment(type=type, field_asts=[operation], context=exe_context)
if execute_serially:
return fragment.resolve_... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/experimental/executor.py | 59 | 66 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,177 | wait_until_finished | def wait_until_finished(self):
pass | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/sync.py | 3 | 4 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,178 | execute | def execute(self, fn, *args, **kwargs):
return fn(*args, **kwargs) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/sync.py | 6 | 7 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,179 | __init__ | def __init__(self, pool=False):
self.threads = []
if pool:
self.execute = self.execute_in_pool
self.pool = ThreadPool(processes=pool)
else:
self.execute = self.execute_in_thread | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/thread.py | 13 | 19 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,180 | wait_until_finished | def wait_until_finished(self):
for thread in self.threads:
thread.join() | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/thread.py | 21 | 23 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,181 | execute_in_thread | def execute_in_thread(self, fn, *args, **kwargs):
promise = Promise()
thread = Thread(target=process, args=(promise, fn, args, kwargs))
thread.start()
self.threads.append(thread)
return promise | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/thread.py | 25 | 30 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,182 | execute_in_pool | def execute_in_pool(self, fn, *args, **kwargs):
promise = Promise()
self.pool.map(lambda input: process(*input), [(promise, fn, args, kwargs)])
return promise | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/thread.py | 32 | 35 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,183 | __init__ | def __init__(self):
self.jobs = [] | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/gevent.py | 11 | 12 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,184 | wait_until_finished | def wait_until_finished(self):
[j.join() for j in self.jobs]
# gevent.joinall(self.jobs) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/gevent.py | 14 | 16 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,185 | execute | def execute(self, fn, *args, **kwargs):
promise = Promise()
job = gevent.spawn(process, promise, fn, args, kwargs)
self.jobs.append(job)
return promise | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/gevent.py | 18 | 22 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,186 | ensure_future | def ensure_future(coro_or_future, loop=None):
"""Wrap a coroutine or an awaitable in a future.
If the argument is a Future, it is returned directly.
"""
if isinstance(coro_or_future, Future):
if loop is not None and loop is not coro_or_future._loop:
raise Val... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/asyncio.py | 11 | 28 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,187 | __init__ | def __init__(self, loop=None):
if loop is None:
loop = get_event_loop()
self.loop = loop
self.futures = [] | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/asyncio.py | 33 | 37 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,188 | wait_until_finished | def wait_until_finished(self):
# if there are futures to wait for
while self.futures:
# wait for the futures to finish
futures = self.futures
self.futures = []
self.loop.run_until_complete(wait(futures)) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/asyncio.py | 39 | 45 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,189 | execute | def execute(self, fn, *args, **kwargs):
result = fn(*args, **kwargs)
if isinstance(result, Future) or iscoroutine(result):
future = ensure_future(result, loop=self.loop)
self.futures.append(future)
return Promise.resolve(future)
return result | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/asyncio.py | 47 | 53 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,190 | process | def process(p, f, args, kwargs):
try:
val = f(*args, **kwargs)
p.do_resolve(val)
except Exception as e:
p.do_reject(e) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/utils.py | 1 | 6 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,191 | queue_process | def queue_process(q):
promise, fn, args, kwargs = q.get()
process(promise, fn, args, kwargs) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/process.py | 8 | 10 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,192 | __init__ | def __init__(self):
self.processes = []
self.q = Queue() | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/process.py | 15 | 17 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,193 | wait_until_finished | def wait_until_finished(self):
for _process in self.processes:
_process.join()
self.q.close()
self.q.join_thread() | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/process.py | 19 | 23 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,194 | execute | def execute(self, fn, *args, **kwargs):
promise = Promise()
self.q.put([promise, fn, args, kwargs], False)
_process = Process(target=queue_process, args=(self.q))
_process.start()
self.processes.append(_process)
return promise | python | wandb/vendor/graphql-core-1.1/wandb_graphql/execution/executors/process.py | 25 | 32 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,195 | __init__ | def __init__(self):
self._data = {} | python | wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/pair_set.py | 4 | 5 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,196 | __contains__ | def __contains__(self, item):
return self.has(item[0], item[1], item[2]) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/pair_set.py | 7 | 8 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,197 | __str__ | def __str__(self):
return str(self._data) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/pair_set.py | 10 | 11 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,198 | __repr__ | def __repr__(self):
return str(self._data) | python | wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/pair_set.py | 13 | 14 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,199 | has | def has(self, a, b, are_mutually_exclusive):
first = self._data.get(a)
result = first and first.get(b)
if result is None:
return False
# are_mutually_exclusive being false is a superset of being true,
# hence if we want to know if this PairSet "has" these two with no... | python | wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/pair_set.py | 16 | 28 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
6,200 | add | def add(self, a, b, are_mutually_exclusive):
_pair_set_add(self._data, a, b, are_mutually_exclusive)
_pair_set_add(self._data, b, a, are_mutually_exclusive)
return self | python | wandb/vendor/graphql-core-1.1/wandb_graphql/pyutils/pair_set.py | 30 | 33 | {
"name": "Git-abouvier/wandb",
"url": "https://github.com/Git-abouvier/wandb.git",
"license": "MIT",
"stars": 0,
"forks": 0
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.